How to automaticly stretch window?

Hey there,
I use a PRC file for my game, but not all computer are 1920 x 1080, so how do I set that it will automaticly stretch to the maximum.
Like when it’s 1280 x 720 it will go to that instead of 1920 x 1080, cuz otherwise not all will be showned

You need to first check for the maximum supported resolution, I’m not sure if what getDisplayModes returns is always sorted, so there’s the extra step that may be useless:

#if this is unclear ask google about the max() function and generator expressions
max_resolution=max(((mode.width, mode.height) for mode in base.pipe.getDisplayInformation().getDisplayModes()))

Then resize the main window (if it’s opened) for example like this:

wp = WindowProperties.getDefault() 

here is an example,

from pandac.PandaModules import *
from direct.showbase.ShowBase import ShowBase

class GameTest(ShowBase):

    def __init__(self):

        wp = WindowProperties()

        self.accept("f", self.fullscreen)

    def fullscreen(self):
           max_resolution = max(((mode.width, mode.height) for mode in
           wp = WindowProperties.getDefault()
           self.accept("f", self.exitFullscreen)

    def exitFullscreen(self):
           wp = WindowProperties.getDefault()
           wp.setSize(1280, 720)
           self.accept("f", self.fullscreen)

load = GameTest()