Created
September 18, 2016 15:16
-
-
Save DavidLudwig/7a354c283cf9f886e1f15d26b0ad9b3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void DrawTestPattern_OpenGL1(float w, float h) | |
{ | |
glCullFace(GL_FRONT_AND_BACK); | |
glBegin(GL_TRIANGLES); | |
glColor3f(1, 0, 0); // top-left | |
glVertex2f(-w, h); // triangle 1 | |
glVertex2f(-w, 0); | |
glVertex2f( 0, 0); | |
glVertex2f( 0, 0); // triangle 2 | |
glVertex2f( 0, h); | |
glVertex2f(-w, h); | |
glColor3f(1, 1, 0); // bottom-left | |
glVertex2f(-w, 0); // triangle 1 | |
glVertex2f(-w, -h); | |
glVertex2f( 0, -h); | |
glVertex2f( 0, -h); // triangle 2 | |
glVertex2f( 0, 0); | |
glVertex2f(-w, 0); | |
glColor3f(1, .5, 0); // bottom-right | |
glVertex2f( 0, 0); // triangle 1 | |
glVertex2f( 0, -h); | |
glVertex2f( w, -h); | |
glVertex2f( w, -h); // triangle 2 | |
glVertex2f( w, 0); | |
glVertex2f( 0, 0); | |
glColor3f(0, 1, 0); // top-left | |
glVertex2f( 0, 0); // triangle 1 | |
glVertex2f( 0, h); | |
glVertex2f( w, h); | |
glVertex2f( w, h); // triangle 2 | |
glVertex2f( w, 0); | |
glVertex2f( 0, 0); | |
glEnd(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment