| 82 | |
| 83 | GLfloat texcoords[8]; |
| 84 | void DrawRectangle(float topLeftX, float topLeftY, float bottomRightX, float bottomRightY) |
| 85 | { |
| 86 | GLfloat verts[8] = { topLeftX, topLeftY, |
| 87 | topLeftX, bottomRightY, |
| 88 | bottomRightX, bottomRightY, |
| 89 | bottomRightX, topLeftY |
| 90 | }; |
| 91 | glVertexPointer(2, GL_FLOAT, 0, verts); |
| 92 | glDrawArrays(GL_TRIANGLE_FAN, 0, 4); |
| 93 | |
| 94 | //TODO: Maybe glFinish needed here instead - if there's some bad graphics crap |
| 95 | glFlush(); |
| 96 | } |
| 97 | void DrawTexture(float topLeftX, float topLeftY, float bottomRightX, float bottomRightY) |
| 98 | { |
| 99 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); |