예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
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
예제 #4
0
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
예제 #5
0
 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
예제 #6
0
 def _set_fullscreen(self, value: bool) -> None:
     sdl2.SDL_SetWindowFullscreen(
         self._window, sdl2.SDL_WINDOW_FULLSCREEN_DESKTOP if value else 0)
예제 #7
0
파일: _sdl2.py 프로젝트: robmcmullen/vispy
 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)
예제 #8
0
파일: screen.py 프로젝트: maxfish/mgl2d
 def full_screen(self, value):
     sdl2.SDL_SetWindowFullscreen(self._window, value)
예제 #9
0
 def leave_fullscreen(self):
     sdl2.SDL_SetWindowFullscreen(self._win.window, 0)
예제 #10
0
 def go_fullscreen(self):
     sdl2.SDL_SetWindowFullscreen(self._win.window,
                                  sdl2.SDL_WINDOW_FULLSCREEN_DESKTOP)