22Quick and dirty controller to get things up and running.
33Thins needs to be improved once more pieces fall in place.
44"""
5- from OpenGL import GL
65import glfw
76from demosys .context .glfw import GLTFWindow
87from demosys .effects .registry import Effect
1413from . import screenshot
1514from demosys import context
1615
16+ # We still use PyOpenGL for samplers and don't want it to halt on errors
17+ import OpenGL
18+ OpenGL .ERROR_CHECKING = False
19+
1720TIMER = None
1821CAMERA = None
1922MANAGER = None
@@ -68,8 +71,6 @@ def run(manager=None):
6871 TIMER = timer_cls ()
6972 TIMER .start ()
7073
71- GL .glClearColor (0.0 , 0.0 , 0.0 , 0.0 )
72-
7374 # Main loop
7475 frames , ft = 0 , 0
7576 prev_time = TIMER .get_time ()
@@ -79,10 +80,14 @@ def run(manager=None):
7980 t = TIMER .get_time ()
8081
8182 # Set the viewport as FBOs will change the values
82- GL .glViewport (0 , 0 , context .WINDOW .buffer_width , context .WINDOW .buffer_height )
83+
84+ context .ctx ().viewport = (0 , 0 , context .WINDOW .buffer_width , context .WINDOW .buffer_height )
8385
8486 # Clear the buffer
85- GL .glClear (GL .GL_COLOR_BUFFER_BIT | GL .GL_DEPTH_BUFFER_BIT | GL .GL_STENCIL_BUFFER_BIT )
87+ context .ctx ().clear (
88+ red = 0.0 , blue = 0.0 , green = 0.0 , alpha = 0.0 , depth = 1.0 ,
89+ viewport = (0 , 0 , context .WINDOW .buffer_width , context .WINDOW .buffer_height )
90+ )
8691
8792 # Tell the manager to draw stuff
8893 manager .draw (t , ft , fbo .WINDOW_FBO )
0 commit comments