11
if( !glfwOpenWindow( 512, 512, 0, 0, 0, 0, 0, 0, GLFW_WINDOW ) )
17
glfwSetWindowTitle("GLFW Application");
23
glfwGetWindowSize( &width, &height );
24
height = height > 0 ? height : 1;
26
glViewport( 0, 0, width, height );
28
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
29
glClear( GL_COLOR_BUFFER_BIT );
31
glMatrixMode( GL_PROJECTION );
33
gluPerspective( 65.0f, (GLfloat)width/(GLfloat)height, 1.0f, 100.0f );
35
// Draw some rotating garbage
36
glMatrixMode( GL_MODELVIEW );
38
gluLookAt(0.0f, -10.0f, 0.0f,
42
//glTranslatef( 1.0f, 1.0f, 0.0f );
43
glRotatef(frame, 0.25f, 1.0f, 0.75f);
44
glBegin( GL_TRIANGLES );
45
glColor3f(0.1f, 0.0f, 0.0f );
46
glVertex3f(0.0f, 3.0f, -4.0f);
47
glColor3f(0.0f, 1.0f, 0.0f );
48
glVertex3f(3.0f, -2.0f, -4.0f);
49
glColor3f(0.0f, 0.0f, 1.0f );
50
glVertex3f(-3.0f, -2.0f, -4.0f);
52
glBegin( GL_TRIANGLES );
53
glColor3f(0.0f, 0.1f, 0.0f );
54
glVertex3f(0.0f, 3.0f, -3.0f);
55
glColor3f(0.0f, 0.0f, 1.0f );
56
glVertex3f(3.0f, -2.0f, -2.0f);
57
glColor3f(1.0f, 0.0f, 0.0f );
58
glVertex3f(-3.0f, -2.0f, 2.0f);
62
// exit if ESC was pressed or window was closed
63
running = !glfwGetKey(GLFW_KEY_ESC) && glfwGetWindowParam( GLFW_OPENED);