Created
September 11, 2009 14:53
Revisions
-
tomonaga revised this gist
Sep 11, 2009 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ import pyglet from pyglet.gl import * import psyco import time FRAME_RATE = 60 USE_FULL_SCREEN = False @@ -19,8 +20,9 @@ def on_resize(width, height): glLoadIdentity() gluOrtho2D(0, 1, 0, 1) INITIAL_TIME = time.time() def update(dt): frame = int((time.time() - INITIAL_TIME) * FRAME_RATE) # do something pyglet.clock.schedule_interval(update, FRAME_RATE) -
tomonaga revised this gist
Sep 11, 2009 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,10 +24,13 @@ def update(dt): # do something pyglet.clock.schedule_interval(update, FRAME_RATE) fps_display = pyglet.clock.ClockDisplay() @window.event def on_draw(): window.clear() # do something fps_display.draw() psyco.cannotcompile(on_resize) psyco.cannotcompile(on_draw) -
tomonaga revised this gist
Sep 11, 2009 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import psyco FRAME_RATE = 60 USE_FULL_SCREEN = False window = pyglet.window.Window(fullscreen=USE_FULL_SCREEN) @window.event def on_resize(width, height): -
tomonaga revised this gist
Sep 11, 2009 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ from pyglet.gl import * import psyco FRAME_RATE = 60 @window.event def on_resize(width, height): global SCREEN_WIDTH, SCREEN_HEIGHT @@ -14,9 +16,15 @@ def on_resize(width, height): glLoadIdentity() gluOrtho2D(0, 1, 0, 1) def update(dt): frame = int((time.time() - initial_time) * FRAME_RATE) # do something pyglet.clock.schedule_interval(update, FRAME_RATE) @window.event def on_draw(): window.clear() # do something psyco.cannotcompile(on_resize) psyco.cannotcompile(on_draw) -
tomonaga created this gist
Sep 11, 2009 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ import pyglet from pyglet.gl import * import psyco @window.event def on_resize(width, height): global SCREEN_WIDTH, SCREEN_HEIGHT SCREEN_WIDTH = width SCREEN_HEIGHT = height glViewport(0, 0, width, height) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0, 1, 0, 1) @window.event def on_draw(): window.clear() psyco.cannotcompile(on_resize) psyco.cannotcompile(on_draw) psyco.full()