... Figure 2. 1 is a
screenshot of the rotating lime green triangle.
Chapter 2
■
Creating a Simple OpenGL Application30
Figure 2. 1 Screenshot of the “OpenGLApplication” example.
02 BOGL_GP CH 02 3/1/04 ... variables. The
g_glRender
pointer is for the
CGfxOpenGL
Chapter 2
■
Creating a Simple OpenGL Application20
02 BOGL_GP CH 02 3/1/04 9:57 AM Page 20
TLFeBOOK
fwKeys = (int)...
... BOGL_GP CH05 3/1/04 10:16 AM Page 121
TLFeBOOK
// using unsigned bytes
glColor3ui (25 5, 25 5, 0);
// using signed bytes in an array
GLbyte yellow[] = { 127 , 127 , 0};
glColor3iv(yellow);
The primary ... Lighting, Blending, and Fog 120
05 BOGL_GP CH05 3/1/04 10:16 AM Page 120
TLFeBOOK
To set up a positional light located at (2, 4, –3), you’d use the following:
GLfloat lightPos[] = { 2....
... factor of 2. 0 along each axis:
glScalef (2. 0f, 2. 0f, 2. 0f);
If you were to draw a 1 × 1 × 1 unit cube after executing the above line, then the cube
would really be drawn as a 2 × 2 × 2 cube. Now, ... without scaling, then apply-
ing a scaling factor of 2. 0 along each axis would place the vertex at the location (2, 2, 2) .
Scaling is performed in OpenGL through the
glScale(...
... m_numVertices is 20 02
{
Chapter 10
■
Up Your Performance 226
10 BOGL_GP CH10 3/1/04 10:05 AM Page 22 6
TLFeBOOK
GL_UNSIGNED_BYTE, image.GetImage());
image.Release();
glEnable(GL_TEXTURE_2D);
// set ... for a display list and
GL_FALSE
otherwise.
Chapter 10
■
Up Your Performance 222
10 BOGL_GP CH10 3/1/04 10:05 AM Page 22 2
TLFeBOOK
GL_RGB_SCALE
and
GL_RGB_ALPHA
are used to set floati...
... relevant portions of this demo.
Chapter 12
■
OpenGL Buffers2 72
Figure 12. 3 Two spheres rendered with motion blur.
12 BOGL_GP CH 12 3/1/04 10:06 AM Page 27 2
TLFeBOOK
■
glColorMask()
allows you to ... value.
GL_ALWAYS
Always passes.
12 BOGL_GP CH 12 3/1/04 10:06 AM Page 26 6
TLFeBOOK
27 7
The Endgame
chapter 13
T
he endgame. This is the end, and we have a game for you. We’ve...