Graphics Reference
In-Depth Information
filling of the v-array and the TRIANGLEFAN parameter of the drawing com-
mand instructing the RC to draw the vertices as connecting triangles.
When we apply the same analysis procedure to the OpenGL drawing routine
( CGrfxWndOGL::OnPaint() ), we get Listing 4.2. We observe the following.
(C1) GL _ CULLFACE is a per-render-context state. In addition, we see that the
OpenGL graphics device has two matrix processors: MODELVIEW and PRO
JECTION . In this case, we program the PROJECTION processor to imple-
ment our coordinate system and leave the MODELVIEW processor initialized
to identity.
(C2) OpenGL implements drawing commands significantly differently from D3D.
Instead of D3D's packaging all vertices and sending the RC one drawing
command, OpenGL sets up the RC (with glBegin() ) before sending the
vertex information (with glVertex3d() ).
4.3
Understanding Tutorials 3.1 and 3.2
We have derived a semantic framework for working with graphics APIs. However,
disciplinary knowledge in computer graphics is necessary to fully understand the
details of graphics API function calls. In the rest of this topic, we will learn
concepts in computer graphics, and we will begin to understand more graphics
API function calls. Fortunately, as is the case in Chapter 3, we will see that the
knowledge we have gathered thus far will allow us to do the following.
1. Apply the framework and understand the semantics of application source
code independent of the graphics API.
2. Design classes to abstract the framework to increase readability, maintain-
ability, and potential for expansion.
Continue with Tutorial 3.1
Tutorial 3.1. We will further
examine the source code from
Tutorial 3.1.
Goal. Demonstrate how to apply the GHC/RC framework with the D3D
graphics API.
Approach. Apply the GHC/RC framework to a very simple D3D drawing
example, for example, Tutorial 3.1.
Search WWH ::




Custom Search