Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <freeglut.h>
- void renderFunction()
- {
- glClear(GL_COLOR_BUFFER_BIT);
- glColor3f(0.0f, 0.0f, 1.0f);
- glBegin(GL_POLYGON);
- glVertex3f(0.0, 0.0, 0.0);
- glVertex3f(0.5, 0.0, 0.0);
- glVertex3f(0.5, 0.5, 0.0);
- glVertex3f(0.0, 0.5, 0.0);
- glEnd();
- glFlush();
- }
- int main(int argc, char **argv)
- {
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_SINGLE);
- glutInitWindowSize(300, 300);
- glutInitWindowPosition(100, 100);
- glutCreateWindow("Hello world");
- glutDisplayFunc(renderFunction);
- glutMainLoop();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment