def test_SDL_GetDisplayMode(self): numdisplays = video.SDL_GetNumVideoDisplays() for index in range(numdisplays): modes = video.SDL_GetNumDisplayModes(index) for mode in range(modes): dmode = video.SDL_DisplayMode() ret = video.SDL_GetDisplayMode(index, mode, byref(dmode)) assert ret == 0
def test_SDL_GetClosestDisplayMode(self): if video.SDL_GetCurrentVideoDriver() == b"dummy": pytest.skip( "dummy video driver does not support closest display modes") numdisplays = video.SDL_GetNumVideoDisplays() for index in range(numdisplays): modes = video.SDL_GetNumDisplayModes(index) dmode = video.SDL_DisplayMode() for mode in range(modes): ret = video.SDL_GetDisplayMode(index, mode, byref(dmode)) #self.assertIsInstance(dmode.contents, video.SDL_DisplayMode) assert ret == 0 cmode = video.SDL_DisplayMode(dmode.format, dmode.w - 1, dmode.h - 1, dmode.refresh_rate) closest = video.SDL_DisplayMode() video.SDL_GetClosestDisplayMode(index, cmode, byref(closest)) assert closest == dmode, SDL_GetError()
def test_SDL_GetNumDisplayModes(self): numdisplays = video.SDL_GetNumVideoDisplays() for index in range(numdisplays): modes = video.SDL_GetNumDisplayModes(index) assert modes >= 1
def test_SDL_GetNumDisplayModes(self): numdisplays = video.SDL_GetNumVideoDisplays() for index in range(numdisplays): modes = video.SDL_GetNumDisplayModes(index) self.assertGreaterEqual(modes, 1)