From be9d6ea4ea36cca5ca6b1f2605cce1cdd45c6d63 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 27 Jun 1998 16:54:59 +0000 Subject: [PATCH] Check for GL_VERSION_1_1 or GL_EXT_texture_object to decide whether to use "EXT" versions of texture management routines. --- Scenery/material.cxx | 13 ++++++++++++- Scenery/tilemgr.cxx | 10 ++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Scenery/material.cxx b/Scenery/material.cxx index b86b3e844..a4a02e2cb 100644 --- a/Scenery/material.cxx +++ b/Scenery/material.cxx @@ -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. diff --git a/Scenery/tilemgr.cxx b/Scenery/tilemgr.cxx index 2762a20a2..92bc3d91e 100644 --- a/Scenery/tilemgr.cxx +++ b/Scenery/tilemgr.cxx @@ -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. -- 2.39.2