| 46 | } |
| 47 | |
| 48 | void drawQuad() { |
| 49 | glMatrixMode(GL_PROJECTION); |
| 50 | glPushMatrix(); |
| 51 | glLoadIdentity(); |
| 52 | glMatrixMode(GL_MODELVIEW); |
| 53 | glPushMatrix(); |
| 54 | glLoadIdentity(); |
| 55 | |
| 56 | const GLfloat v[8] = { |
| 57 | -1.0f, -1.0f, |
| 58 | 1.0f, -1.0f, |
| 59 | -1.0f, 1.0f, |
| 60 | 1.0f, 1.0f |
| 61 | }; |
| 62 | |
| 63 | GLboolean origVertexArrayState = glIsEnabled(GL_VERTEX_ARRAY); |
| 64 | if (!origVertexArrayState) { |
| 65 | glEnableClientState(GL_VERTEX_ARRAY); |
| 66 | } |
| 67 | |
| 68 | glVertexPointer(2, GL_FLOAT, 0, v); |
| 69 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); |
| 70 | |
| 71 | if (!origVertexArrayState) { |
| 72 | glDisableClientState(GL_VERTEX_ARRAY); |
| 73 | } |
| 74 | |
| 75 | glMatrixMode(GL_PROJECTION); |
| 76 | glPopMatrix(); |
| 77 | glMatrixMode(GL_MODELVIEW); |
| 78 | glPopMatrix(); |
| 79 | } |
| 80 | |
| 81 | } // namespace OpenGL |
| 82 |
no outgoing calls
no test coverage detected