Ejemplo n.º 1
0
 def test_get_window_display_mode(self):
     flags = (video.SDL_WINDOW_BORDERLESS,
              video.SDL_WINDOW_BORDERLESS | video.SDL_WINDOW_HIDDEN)
     for flag in flags:
         window = video.create_window("Test", 10, 10, 10, 10, flag)
         dmode = video.get_window_display_mode(window)
         self.assertIsInstance(dmode, video.SDL_DisplayMode)
         video.destroy_window(window)
         self.assertRaises(sdl.SDLError, video.get_window_display_mode,
                           window)
Ejemplo n.º 2
0
    def test_set_window_display_mode(self):
        flags = (video.SDL_WINDOW_BORDERLESS,
                 video.SDL_WINDOW_BORDERLESS | video.SDL_WINDOW_HIDDEN)
        for flag in flags:
            window = video.create_window("Test", 10, 10, 10, 10, flag)
            dindex = video.get_window_display(window)
            dmode = video.get_current_display_mode(dindex)

            video.set_window_display_mode(window, dmode)
            wmode = video.get_window_display_mode(window)
            self.assertEqual(dmode.format, wmode.format)
            self.assertEqual(dmode.w, wmode.w)
            self.assertEqual(dmode.h, wmode.h)
            self.assertEqual(dmode.refresh_rate, wmode.refresh_rate)

            video.destroy_window(window)
            self.assertRaises(sdl.SDLError, video.set_window_display_mode,
                              window, dmode)