-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cpp
35 lines (28 loc) · 699 Bytes
/
test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
////////////////////////////////////////////////////////
//
// This should be your first OpenGL/Glut program
// do nothing but draw a yellow rectangular polygon at the
// center of the window
//
////////////////////////////////////////////////////////
#include <GLUT/glut.h>
#include <OpenGL/gl.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor4f(1,1,0,1);
glBegin(GL_POLYGON);
glVertex2f(-0.5, -0.5);
glVertex2f(-0.5, 0.5);
glVertex2f(0.5, 0.5);
glVertex2f(0.5, -0.5);
glEnd();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutCreateWindow("simple");
glutDisplayFunc(display);
glutMainLoop();
}