- glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity;
- gluPerspective(45.0, ClientWidth/ClientHeight, NearClipping, FarClipping);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity;
- ...
- glInitNames;
- glPushName(0);
- glLoadName(1);
- glbegin(GL_QUADS);
- glvertex3f(0,0,0);
- glvertex3f(0,0,1);
- glvertex3f(1,0,1);
- glvertex3f(1,0,0);
- glend;
- glLoadName(2);
- glbegin(GL_QUADS);
- glvertex3f(1,0,1);
- glvertex3f(1,0,2);
- glvertex3f(2,0,2);
- glvertex3f(2,0,1);
- glend;