... rendering. Frustum culling can be toggled
Frustum Culling 2 45
Figure 10 .5 An example of frustum culling.
10 BOGL_GP CH10 3/1/04 10: 05 AM Page 2 45
TLFeBOOK
The
array
parameter is a flag indicating which ... performance. Fortunately, you know more about your game data
than OpenGL does, and you can use this information to make rendering more efficient.
For example, your game genera...
... finished writing OpenGL Game Programming. Although the
book didn’t cover everything we had initially planned, we hoped that it would bene-
fit people learning to program games with OpenGL. The ensuing ... related Windows functions that support OpenGL
■
Pixel formats
■
Using OpenGL with Windows
■
Full-screen OpenGL
Introduction to WGL
The set of APIs used to set up OpenGL on Wind...
... height
NULL, // handle to parent
NULL, // handle to menu
An OpenGL Application 25
02 BOGL_GP CH02 3/1/04 9 :57 AM Page 25
TLFeBOOK
Full-Screen OpenGL
The code presented in the previous section creates ...
CGfxOpenGL
class, whose definition is
shown below.
From
CGfxOpenGL.h:
class CGfxOpenGL
{
private:
int m_windowWidth;
int m_windowHeight;
float m_angle;
public:
CGfxOpenGL();
virtual...
... States and Primitives56
03 BOGL_GP CH03 3/1/04 2:34 PM Page 56
TLFeBOOK
translation transformation of +5 units along the x axis. The final position of the triangle
would be (5, 4.33) with the arrow ... GL_LINE);
5)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
Handling Primitives 53
Figure 3 .5 Screenshot of the Polygons example in Chapter 3 on the CD.
03 BOGL_GP CH03 3/1/04 2:34 PM Page...
... S
A
*S
A
= 0*0 .5, 0*0 .5, 1*0 .5, 0 .5* 0 .5 = 0, 0, 0 .5, 0. 25
destination color = D
R
*(1–S
A
), S
G
*(1–S
A
), S
B
*(1–S
A
), S
A
*(1–S
A
) = 1*0 .5, 0*0 .5, 0*0 .5,
1*0 .5 = 0 .5, 0, 0, 0 .5
These two values ... result of (0 .5, 0, 0 .5, 0. 75) .
You can see the results of this in Figure 5. 9.
Blending 123
Figure 5. 9 A blue triangle with 50 percent transparency drawn over
a red...
... 13
■
The Endgame278
Figure 13.1 Classes and their dependencies in the game.
Table 13.1 Chess Game Classes
Class Description
CGfxOpenGL
The OpenGL rendering class. The majority of OpenGL rendering ... used
OpenGL in the game. We invite you to modify the game code and make additions if you
would like. Use your imagination!
In this chapter we will cover:
■
Chess game technical d...