glMatrixMode GL_PROJECTION glPushMatrix glLoadIdentity glOrtho static_

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0, static_cast<double>(width), static_cast<double>(height), 0, 0, 1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glBegin (GL_QUADS);
glTexCoord2d (0.0, 0.0);
glVertex3f (0.0, 0.0, 0.0);
glTexCoord2d (0.0, 1.0);
glVertex3f (0.0, static_cast<GLfloat>(height), 0.0);
glTexCoord2d (1.0, 1.0);
glVertex3f (static_cast<GLfloat>(width), static_cast<GLfloat>(height), 0.0);
glTexCoord2d (1.0, 0.0);
glVertex3f (static_cast<GLfloat>(width), 0.0, 0.0);
glEnd();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);