Glide provides a family of error management functions to assist a developer with application debugging. This family of routines consists of Glide related error management (errors generated by Glide) and application level error management (errors generated by an application).
The debug build of Glide performs extensive parameter validation and resource checking. When an error condition is detected, a user-supplied callback function may be executed. This callback function is installed by calling grErrorSetCallback(). If no callback function is specified, a default error function that prints an error message to stderr is used.
void grErrorSetCallback( void (*function)(const char *string, FxBool fatal) )
The callback function accepts a string describing the error and a flag indicating if the error is fatal or recoverable. grErrorSetCallback() is relevant only when using the debugging version of Glide; the release build of Glide removes all internal parameter validation and error checking so the callback function will never be called.
Chapter 4. Rendering Primitives
You will learn how to:
establish a clipping window
draw a point, a line, a triangle, or a convex polygon on the screen
cull back-facing polygons from the scene
draw an anti-aliased point, line, triangle, or convex polygon
2The GrVertex Structure
The GrVertex structure, first presented in Chapter 2, collects together all the parameters that define a vertex. In this chapter, only the x and y coordinates will be discussed; the other parameters are called into play in later chapters.
typedef struct {
float x, y, z; /* x, y, z of screen space. Z is ignored */
float ooz; /* 65535/z (used for z buffering) */
float oow; /* 1/w (used for w buffering) */
float r, g, b, a; /* red, green, blue, and alpha ([0..255.0]) */
GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
} GrVertex;
The x and y coordinates are 32-bit floating point values that represent the position of the vertex in screen space. While the Voodoo Graphics hardware renders only triangles, Glide provides functions to draw points, lines, and polygons as well as triangles.
When a point, line, triangle, or polygon is rendered, its appearance will reflect the current state of the rendering pipeline. That is, if texture mapping is enabled, then the point, line, triangle, or polygon will be texture mapped. Similarly, alpha blending, fogging, color, and lighting effects, chroma-keying, and other special effects will contribute to the appearance of any and all geometric shapes drawn while they are enabled.
Share with your friends: |