MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / DrawRectangle

Function DrawRectangle

Samples/NiUserTracker/SceneDrawer.cpp:84–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83GLfloat texcoords[8];
84void 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}
97void DrawTexture(float topLeftX, float topLeftY, float bottomRightX, float bottomRightY)
98{
99 glEnableClientState(GL_TEXTURE_COORD_ARRAY);

Callers 1

DrawTextureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected