glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if ((gluerr = gluBuild2DMipmaps(GL_TEXTURE_2D, 3, 128, 128, GL_RGB,
GL_UNSIGNED_BYTE, (GLvoid *) (&tex[0])))) {
- fprintf(stderr, "GLULib%s\n", gluErrorString(gluerr));
+ fprintf(stderr, "GLULib%s\n", (char *) gluErrorString(gluerr));
exit(-1);
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if ((gluerr = gluBuild2DMipmaps(GL_TEXTURE_2D, 3, 128, 128, GL_RGB,
GL_UNSIGNED_BYTE, (GLvoid *) (&tex[0])))) {
- fprintf(stderr, "GLULib%s\n", gluErrorString(gluerr));
+ fprintf(stderr, "GLULib%s\n", (char *) gluErrorString(gluerr));
exit(-1);
}
-/* $Id: shadowtex.c,v 1.7 2002/07/12 15:54:02 brianp Exp $ */
-
/*
* Shadow demo using the GL_ARB_depth_texture, GL_ARB_shadow and
* GL_ARB_shadow_ambient extensions (or the old SGIX extensions).
error = glGetError();
if (error) {
- printf("GL Error: %s\n", gluErrorString(error));
+ printf("GL Error: %s\n", (char *) gluErrorString(error));
}
}
-/* $Id: stex3d.c,v 1.9 2003/03/31 16:51:38 brianp Exp $ */
-
/*-----------------------------
* stex3d.c GL example of the mesa 3d-texture extention to simulate procedural
* texturing, it uses a perlin noise and turbulence functions.
}
-void
+static void
create3Dgradient(void)
{
unsigned char *v;
};
#define NUM_ENV_COLORS (sizeof(envColors) / sizeof(envColors[0]))
-int envColor;
+int envColor = 0;
GLfloat envColors[][4] =
{
{ 0.0, 0.0, 0.0, 1.0 },
{
GLenum error;
- return;
-
while ( (error = glGetError()) != GL_NO_ERROR ) {
fprintf( stderr, "Error: %s\n", (char *) gluErrorString( error ) );
}
{
switch ( c ) {
case 'c':
- envColor = (++envColor) % (int) NUM_ENV_COLORS;
+ envColor++;
+ envColor = envColor % (int) NUM_ENV_COLORS;
break;
case 'g':
drawBackground = !drawBackground;
-/* $Id: texobj.c,v 1.6 2002/01/04 21:05:57 brianp Exp $ */
+/* $Id: texobj.c,v 1.7 2003/04/21 14:50:12 brianp Exp $ */
/*
* Example of using the 1.1 texture object functions.
#include <assert.h>
#include <math.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GL/glut.h"