]> git.mxchange.org Git - flightgear.git/commitdiff
Check for GL_VERSION_1_1 or GL_EXT_texture_object to decide whether to use
authorcurt <curt>
Sat, 27 Jun 1998 16:54:59 +0000 (16:54 +0000)
committercurt <curt>
Sat, 27 Jun 1998 16:54:59 +0000 (16:54 +0000)
  "EXT" versions of texture management routines.

Scenery/material.cxx
Scenery/tilemgr.cxx

index b86b3e8449c203da1edb911303571ec591ca08aa..a4a02e2cb6dfc87c5eba7cd3b5be507eb175bfc7 100644 (file)
@@ -137,8 +137,15 @@ int fgMATERIAL_MGR::load_lib ( void ) {
            sscanf(line_ptr, "%s\n", m.texture_name);
 
            // create the texture object and bind it
+#ifdef GL_VERSION_1_1
            xglGenTextures(1, &m.texture_id);
            xglBindTexture(GL_TEXTURE_2D, m.texture_id);
+#elif GL_EXT_texture_object
+           xglGenTexturesEXT(1, &m.texture_id);
+           xglBindTextureEXT(GL_TEXTURE_2D, m.texture_id);
+#else
+#  error port me
+#endif
 
            // set the texture parameters for this texture
            xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ) ;
@@ -164,7 +171,7 @@ int fgMATERIAL_MGR::load_lib ( void ) {
                if ( (texbuf = read_rgb_texture(fg_tpath, &width, &height)) 
                     == NULL ) {
                    fgPrintf( FG_GENERAL, FG_EXIT, 
-                             "Error in loading texture %s\n", tpath );
+                             "Error loading texture %s\n", tpath );
                    return(0);
                } 
            } 
@@ -248,6 +255,10 @@ fgMATERIAL_MGR::~fgMATERIAL_MGR ( void ) {
 
 
 // $Log$
+// Revision 1.6  1998/06/27 16:54:59  curt
+// Check for GL_VERSION_1_1 or GL_EXT_texture_object to decide whether to use
+//   "EXT" versions of texture management routines.
+//
 // Revision 1.5  1998/06/17 21:36:39  curt
 // Load and manage multiple textures defined in the Materials library.
 // Boost max material fagments for each material property to 800.
index 2762a20a2ef2707edaec18060f8c7df8906fd446..92bc3d91ef571ff32d36855792fae73c8087c91a 100644 (file)
@@ -433,7 +433,13 @@ void fgTileMgrRender( void ) {
        size = mtl_ptr->list_size;
        if ( size > 0 ) {
            if ( o->textures ) {
+#ifdef GL_VERSION_1_1
                xglBindTexture(GL_TEXTURE_2D, mtl_ptr->texture_id);
+#elif GL_EXT_texture_object
+               xglBindTextureEXT(GL_TEXTURE_2D, mtl_ptr->texture_id);
+#else
+#  error port me
+#endif
            } else {
                xglMaterialfv (GL_FRONT, GL_AMBIENT, mtl_ptr->ambient);
                xglMaterialfv (GL_FRONT, GL_DIFFUSE, mtl_ptr->diffuse);
@@ -474,6 +480,10 @@ void fgTileMgrRender( void ) {
 
 
 // $Log$
+// Revision 1.21  1998/06/27 16:54:59  curt
+// Check for GL_VERSION_1_1 or GL_EXT_texture_object to decide whether to use
+//   "EXT" versions of texture management routines.
+//
 // Revision 1.20  1998/06/17 21:36:42  curt
 // Load and manage multiple textures defined in the Materials library.
 // Boost max material fagments for each material property to 800.