Skip to content

Commit 6056f23

Browse files
lejarcztomczak
authored andcommitted
Make pysdl2 example python 3 compatible. (cztomczak#543)
1 parent 8cede99 commit 6056f23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/pysdl2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def main():
169169
logging.debug("SDL2 initialised")
170170
# Create the window
171171
window = sdl2.video.SDL_CreateWindow(
172-
'cefpython3 SDL2 Demo',
172+
b'cefpython3 SDL2 Demo',
173173
sdl2.video.SDL_WINDOWPOS_UNDEFINED,
174174
sdl2.video.SDL_WINDOWPOS_UNDEFINED,
175175
width,
@@ -382,7 +382,7 @@ def main():
382382
# regulate frame rate
383383
if sdl2.timer.SDL_GetTicks() - startTime < 1000.0 / frameRate:
384384
sdl2.timer.SDL_Delay(
385-
(1000 / frameRate) - (sdl2.timer.SDL_GetTicks() - startTime)
385+
(1000 // frameRate) - (sdl2.timer.SDL_GetTicks() - startTime)
386386
)
387387
# User exited
388388
exit_app()

0 commit comments

Comments
 (0)