HP Workstation zx2000 Implementation Manual page 14

Hp opengl implementation guide for hp-ux 11.x (ipf version) (5969-3152)
Hide thumbs Also See for Workstation zx2000:
Table of Contents

Advertisement

overview of OpenGL
3D texture program fragments
This program draws four layers in the base MIPmap level, and a diagonal slice through the base
MIPmap level.
/* Allocate texture levels separately, then concat to get 3D
texture */
GLubyte texture1[TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
GLubyte texture2[TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
GLubyte texture3[TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
GLubyte texture4[TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
GLubyte
textureConcat[TEXTURE_DEPTH][TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
/* The checkerPattern procedure fills a texture of width and
height with a period of Checker_period alternating between
firstColor and secondColor, Texture should be declared prior to
calling checkerPattern. */
static void checkerPattern(int width, int height,
{
int
int
GLubyte
index = 0;
for (texelY = 0; texelY < height; texelY++) {
for (texelX = 0; texelX < width; texelX++) {
if (((texelX/Checker_period)% 2) ^
((texelY/Checker_period)% 2)) {
*p++ = firstColor[0]; /* red */
*p++ = firstColor[1]; /* green */
*p++ = firstColor[2]; /* blue */
*p++ = firstColor[3]; /* alpha */
} else {
}
}
}
GLubyte blackRGBA[] = {0.0, 0.0, 0.0, 255.0};
GLubyte whiteRGBA[] = {255.0, 255.0, 255.0, 255.0};
GLubyte redRGBA[] = {255.0, 0.0, 0.0, 255.0};
GLubyte greenRGBA[] = {0.0, 255.0, 0.0, 255.0};
GLubyte blueRGBA[] = {0.0, 0.0, 255.0, 255.0};
GLubyte yellowRGBA[]= {255.0, 255.0, 0.0, 255.0};
1–10
GLubyte *firstColor,
GLubyte *secondColor,
GLubyte *texture,
int Checker_period)
texelX, texelY;
index, fromIndex;
*p = texture;
*p++ = secondColor[0]; /* red */
*p++ = secondColor[1]; /* green */
*p++ = secondColor[2]; /* blue */
*p++ = secondColor[3]; /* alpha */
OpenGL implementation guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

Workstation zx6000

Table of Contents