11import moderngl
2- from demosys . conf import settings
3- from demosys .conf import ImproperlyConfigured
2+ from demosys import context
3+ from demosys .conf import ImproperlyConfigured , settings
44from demosys .opengl .fbo import FBO
55
66from .base import Window
@@ -19,7 +19,16 @@ def __init__(self):
1919
2020 self ._close = False
2121 self .ctx = moderngl .create_standalone_context ()
22- self .screenbuffer = FBO .create ((self .width , self .height ), depth = True )
22+
23+ self .fbo = FBO ()
24+ self .fbo .ctx = self .ctx
25+ self .fbo .fbo = self .ctx .framebuffer (
26+ color_attachments = self .ctx .texture ((self .width , self .height ), 4 ),
27+ depth_attachment = self .ctx .depth_texture ((self .width , self .height )),
28+ )
29+ # self.fbo.default_framebuffer = True
30+ context .WINDOW = self
31+ self .set_default_viewport ()
2332
2433 def draw (self , current_time , frame_time ):
2534 super ().draw (current_time , frame_time )
@@ -28,7 +37,7 @@ def draw(self, current_time, frame_time):
2837 self .close ()
2938
3039 def use (self ):
31- self .screenbuffer .use (stack = False )
40+ self .fbo .use (stack = False )
3241
3342 def should_close (self ):
3443 return self ._close
0 commit comments