Created
December 1, 2012 07:14
-
-
Save tuttlem/4180941 to your computer and use it in GitHub Desktop.
OpenGL2D - drawing
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
/* note that we're not clearing the depth buffer */ | |
glClear(GL_COLOR_BUFFER_BIT); | |
glMatrixMode(GL_MODELVIEW); | |
glLoadIdentity(); | |
/* draw a triangle */ | |
glBegin(GL_TRIANGLES); | |
glColor3ub(255, 0, 0); | |
glVertex2d(0, 0); | |
glColor3ub(0, 255, 0); | |
glVertex2d(100,0); | |
glColor3ub(0, 0, 255); | |
glVertex2d(50, 50); | |
glEnd(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment