Created
January 31, 2011 05:17
-
-
Save mikedouglas/803667 to your computer and use it in GitHub Desktop.
This file contains 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
#ifdef __APPLE__ | |
#include <OpenGL/gl.h> | |
#include <OpenGL/glu.h> | |
#include <GLUT/glut.h> | |
#else | |
#ifdef _WIN32 | |
#include <windows.h> | |
#endif | |
#include <GL/gl.h> | |
#include <GL/glu.h> | |
#include <GL/glut.h> | |
#endif | |
void Init() { | |
glClearColor(1, 1, 1, 0); | |
glClear(GL_COLOR_BUFFER_BIT); | |
glColor3f(0, 0, 0); | |
glLoadIdentity(); | |
} | |
void RenderScene() { | |
glRectf(-0.5, -0.5, 0.5, 0.5); | |
glutSwapBuffers(); | |
} | |
int main(int argc, char** argv) { | |
glutInit(&argc, argv); | |
glutInitWindowSize(500, 500); | |
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA); | |
glutCreateWindow("My second OpenGL Program"); | |
glutDisplayFunc(RenderScene); | |
Init(); | |
glutMainLoop(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment