Mercurial > touhou
comparison pytouhou/ui/window.pyx @ 596:ab131d04987d
Fix a regression introduced in the previous commit when the interface has a different resolution than 640×480 and framebuffer_blit is enabled.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 25 Oct 2014 18:49:41 +0200 |
parents | 12756994a92c |
children | 3c2f96f1d715 |
comparison
equal
deleted
inserted
replaced
595:b7b4a234bf70 | 596:ab131d04987d |
---|---|
75 return False | 75 return False |
76 | 76 |
77 | 77 |
78 | 78 |
79 cdef class Window: | 79 cdef class Window: |
80 def __init__(self, backend, long fps_limit=-1, frameskip=1): | 80 def __init__(self, backend, int width=640, int height=480, long fps_limit=-1, frameskip=1): |
81 if backend is not None: | 81 if backend is not None: |
82 self.win = backend.create_window( | 82 self.win = backend.create_window( |
83 'PyTouhou', | 83 'PyTouhou', |
84 sdl.WINDOWPOS_CENTERED, sdl.WINDOWPOS_CENTERED, | 84 sdl.WINDOWPOS_CENTERED, sdl.WINDOWPOS_CENTERED, |
85 640, 480, #XXX | 85 width, height, |
86 frameskip) | 86 frameskip) |
87 | 87 |
88 self.clock = Clock(fps_limit) | 88 self.clock = Clock(fps_limit) |
89 self.frame = 0 | 89 self.frame = 0 |
90 self.frameskip = frameskip | 90 self.frameskip = frameskip |
91 self.width = width | |
92 self.height = height | |
91 | 93 |
92 | 94 |
93 cdef void set_size(self, int width, int height) nogil: | 95 cdef void set_size(self, int width, int height) nogil: |
94 self.win.set_window_size(width, height) | 96 self.win.set_window_size(width, height) |
95 | 97 |