Skip to content

Commit 3d49c36

Browse files
committed
Remove pyopengl from controller
1 parent 8a0e8b7 commit 3d49c36

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

demosys/view/controller.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Quick and dirty controller to get things up and running.
33
Thins needs to be improved once more pieces fall in place.
44
"""
5-
from OpenGL import GL
65
import glfw
76
from demosys.context.glfw import GLTFWindow
87
from demosys.effects.registry import Effect
@@ -14,6 +13,10 @@
1413
from . import screenshot
1514
from 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+
1720
TIMER = None
1821
CAMERA = None
1922
MANAGER = 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

Comments
 (0)