Welcome to pyprojector’s documentation!¶
Reference¶
-
pyprojector.
window
(size=(width, height), title: str, icon: str, fps: int) → Window¶ The default fps is
60
. Set fps to0
to disable sleep during theWindow.update()
.
-
Window.
update
(framebuffer: int) → bool¶ framebuffer is an OpenGL Framebuffer Object.
Note
The framebuffer must be a valid OpenGL Framebuffer Object in the windows context. If the framebuffer was created in another OpenGL context that does not share objects with the window’s OpenGL context, the render will fail silently.
-
Window.visible:bool
Examples¶
simple window
import moderngl
import pyprojector
wnd = pyprojector.window((840, 480), __file__, fps=60)
ctx = moderngl.context()
wnd.detach()
rbo = ctx.renderbuffer(wnd.size)
fbo = ctx.framebuffer(rbo)
while wnd.visible:
fbo.clear(color=(0.0, 0.0, 0.0))
wnd.update(rbo)