int textureHeight = 64;
int winWidth = 580, winHeight = 720;
+static int Win;
+
struct formatInfo {
GLenum baseFormat;
};
#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;
displayLevelInfo = !displayLevelInfo;
break;
case 27: /* Escape key should force exit. */
+ glutDestroyWindow(Win);
exit(0);
break;
default:
break;
case GL_INTENSITY:
luminanceSize = 1;
- textureFormat = GL_INTENSITY;
+ /* Note: format=GL_INTENSITY for glTexImage is not legal */
+ textureFormat = GL_LUMINANCE;
break;
case GL_ALPHA:
alphaSize = 1;
glutInitWindowSize( winWidth, winHeight );
glutInitWindowPosition( 0, 0 );
- glutCreateWindow( "Texture Environment Test" );
+ Win = glutCreateWindow( "Texture Environment Test" );
initialize();
instructions();