def __init__(self, window): self.window = window self.world = sdl2.ext.World() self.sdl_renderer = sdl2.SDL_CreateRenderer( window, -1, sdl2.SDL_RENDERER_ACCELERATED) sdl2.SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP) sdl2.SDL_GL_SetSwapInterval(1)
def maximise_window(self, index): if index > 0 and index <= len(self.screens): window = self.screens[index - 1].window rect = sdl2.SDL_Rect() sdl2.SDL_GetDisplayBounds(index - 1, ctypes.byref(rect)) sdl2.SDL_SetWindowSize(window.window, rect.w, rect.h) sdl2.SDL_SetWindowFullscreen(window.window, sdl2.SDL_WINDOW_FULLSCREEN)
def set_fullscreen(real_fullscreen: bool = False): """ Activates Fullscreen, for the Pyxel window :return: :rtype: """ current_window = sdl2.SDL_GL_GetCurrentWindow() sdl2.SDL_SetWindowFullscreen(current_window, sdl2.SDL_WINDOW_FULLSCREEN if real_fullscreen else sdl2.SDL_WINDOW_FULLSCREEN_DESKTOP) pyxel.is_fullscreen = True
def set_windowed(): """ Activates windowed mode for Pyxel :return: :rtype: """ current_window = sdl2.SDL_GL_GetCurrentWindow() sdl2.SDL_SetWindowFullscreen(current_window, 0) pyxel.is_fullscreen = False
def __init__(self, size=(600, 600), major=4, minor=0, fullscreen=False): if GLWindow.instance: raise Exception("Window already created!") self.size = tuple(size) self.major = major self.minor = minor self.printFPS = False self.periodTime = 0 self.fpsPeriod = 1000 self.fpsDelay = self.fpsPeriod self.numFrames = 0 self.timeStep = 10 self.__buildWindow() if fullscreen: sdl2.SDL_SetWindowFullscreen(self.window, sdl2.SDL_WINDOW_FULLSCREEN) GLWindow.instance = self
def _set_fullscreen(self, value: bool) -> None: sdl2.SDL_SetWindowFullscreen( self._window, sdl2.SDL_WINDOW_FULLSCREEN_DESKTOP if value else 0)
def _vispy_set_fullscreen(self, fullscreen): self._fullscreen = bool(fullscreen) flags = sdl2.SDL_WINDOW_FULLSCREEN_DESKTOP if self._fullscreen else 0 sdl2.SDL_SetWindowFullscreen(self._id.window, flags)
def full_screen(self, value): sdl2.SDL_SetWindowFullscreen(self._window, value)
def leave_fullscreen(self): sdl2.SDL_SetWindowFullscreen(self._win.window, 0)
def go_fullscreen(self): sdl2.SDL_SetWindowFullscreen(self._win.window, sdl2.SDL_WINDOW_FULLSCREEN_DESKTOP)