-/* $Id: texobj.c,v 1.3 2000/03/01 03:36:40 brianp Exp $ */
+/* $Id: texobj.c,v 1.4 2000/03/23 16:57:14 brianp Exp $ */
/*
* Example of using the 1.1 texture object functions.
* Brian Paul June 1996 This file is in the public domain.
*/
-
-/*
- * $Log: texobj.c,v $
- * Revision 1.3 2000/03/01 03:36:40 brianp
- * test for GL 1.2
- *
- * Revision 1.2 2000/02/25 23:24:06 brianp
- * fixed bug when using display lists
- *
- * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
- * Imported sources
- *
- * Revision 3.1 1999/03/28 18:24:37 brianp
- * minor clean-up
- *
- * Revision 3.0 1998/02/14 18:42:29 brianp
- * initial rev
- *
- */
-
-
#include <math.h>
#include <stdlib.h>
#include <string.h>
static GLuint TexObj[2];
static GLfloat Angle = 0.0f;
-static GLboolean HaveTexObj = GL_FALSE;
+static GLboolean UseObj = GL_FALSE;
#if defined(GL_VERSION_1_1) || defined(GL_VERSION_1_2)
glPushMatrix();
glTranslatef( -1.0, 0.0, 0.0 );
glRotatef( Angle, 0.0, 0.0, 1.0 );
- if (HaveTexObj) {
+ if (UseObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, TexObj[0] );
#endif
glPushMatrix();
glTranslatef( 1.0, 0.0, 0.0 );
glRotatef( Angle-90.0, 0.0, 1.0, 0.0 );
- if (HaveTexObj) {
+ if (UseObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, TexObj[1] );
#endif
/* generate texture object IDs */
- if (HaveTexObj) {
+ if (UseObj) {
#ifdef TEXTURE_OBJECT
glGenTextures( 2, TexObj );
#endif
}
/* setup first texture object */
- if (HaveTexObj) {
+ if (UseObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, TexObj[0] );
#endif
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
- if (!HaveTexObj) {
+ if (!UseObj) {
glEndList();
}
/* end of texture object */
/* setup second texture object */
- if (HaveTexObj) {
+ if (UseObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, TexObj[1] );
#endif
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
- if (!HaveTexObj) {
+ if (!UseObj) {
glEndList();
}
/* end texture object */
if ( strstr( exten, "GL_EXT_texture_object" )
|| strncmp( version, "1.1", 3 )==0
|| strncmp( version, "1.2", 3 )==0 ) {
- HaveTexObj = GL_TRUE;
+ UseObj = GL_TRUE;
}
}
#endif