/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
from pyglet.gl import * # Direct OpenGL commands to this window. window = pyglet.window.Window() @window.event def on_draw(): glClear(GL_COLOR_BUFFER_BIT) glLoadIdentity() glBegin(GL_TRIANGLES) glVertex2f(0, 0) glVertex2f(window.width, 0) glVertex2f(window.width, window.height) glEnd() pyglet.app.run()