Game Development Reference
In-Depth Information
glVertex3f(-10.0f, 10.0f, -10.0f);
glVertex3f(10.0f, 10.0f, -10.0f);
// left
glColor3f(0.0f, 0.0f, 1.0f);
glVertex3f(-10.0f, -10.0f, -10.0f);
glVertex3f(-10.0f, -10.0f, 10.0f);
glVertex3f(-10.0f, 10.0f, 10.0f);
glVertex3f(-10.0f, 10.0f, -10.0f);
// right
glColor3f(1.0f, 1.0f, 0.0f);
glVertex3f(10.0f, -10.0f, 10.0f);
glVertex3f(10.0f, -10.0f, -10.0f);
glVertex3f(10.0f, 10.0f, -10.0f);
glVertex3f(10.0f, 10.0f, 10.0f);
// top
glColor3f(1.0f, 0.0f, 1.0f);
glVertex3f(-10.0f, 10.0f, 10.0f);
glVertex3f(10.0f, 10.0f, 10.0f);
glVertex3f(10.0f, 10.0f, -10.0f);
glVertex3f(-10.0f, 10.0f, -10.0f);
// bottom
glColor3f(0.0f, 1.0f, 1.0f);
glVertex3f(-10.0f, -10.0f, -10.0f);
glVertex3f(10.0f, -10.0f, -10.0f);
glVertex3f(10.0f, -10.0f, 10.0f);
glVertex3f(-10.0f, -10.0f, 10.0f);
glEnd();
}
GLUT is a great way to experiment with OpenGL commands, but
sometimes you need a little more control over the runtime of your
application. For this reason you need to learn how to set up the windows
without using GLUT. On the Windows platform, most of the OpenGL-
related windows code is prefixed with 'wgl'. Let's look at how to set up a
window using these methods.
Creating a double buffered window using
PIXELFORMATDESCRIPTOR
Now we will look at another method for setting up an OpenGL application,
this time using Microsoft Foundation Classes (MFC). This topic does not
Search Nedrilad ::




Custom Search