- glClearColor(0,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
- glLoadIdentity;
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity;
- glOrtho(0, 800, 600, 0, -1, 1);
- glMatrixMode(GL_MODELVIEW);
-
- glpushmatrix;
- glcolor3f(1,0.5,0);
- glbegin(gl_quads);
- glvertex2f(0,600);
- glvertex2f(0,0);
- glvertex2f(800,0);
- glvertex2f(800,600);
- glend();
- glpopmatrix;
- glpushmatrix;
- gltranslatef(x,y,0);
- glcolor3f(0,0.5,1);
- glbegin(gl_triangles);
- glvertex2f(380,580);
- glvertex2f(400,540);
- glvertex2f(420,580);
- glend();
- glpopmatrix;