. , SDL , , python.
import pyglet
from pyglet.gl import *
class Application(object):
def __init__(self):
self.window = window = pyglet.window.Window()
window.push_handlers(self)
def on_draw(self):
self.window.clear()
glBegin(GL_TRIANGLES)
glVertex2f(0,0)
glVertex2f(200,0)
glVertex2f(200,200)
glEnd()
if __name__=='__main__':
app = Application()
pyglet.app.run()
, . .
, , , , , , , . , . , .
opengl. , , C, . :
from pyglet.gl import Begin, Vertex2f, TRIANGLES, End
...
Begin(TRIANGLES)
Vertex2f(0,0)
Vertex2f(200,0)
Vertex2f(200,200)
End()