Check for GL_VERSION_1_1 or GL_EXT_texture_object to decide whether to use
"EXT" versions of texture management routines.
This commit is contained in:
parent
353ec70f8c
commit
be9d6ea4ea
2 changed files with 22 additions and 1 deletions
Scenery
|
@ -137,8 +137,15 @@ int fgMATERIAL_MGR::load_lib ( void ) {
|
||||||
sscanf(line_ptr, "%s\n", m.texture_name);
|
sscanf(line_ptr, "%s\n", m.texture_name);
|
||||||
|
|
||||||
// create the texture object and bind it
|
// create the texture object and bind it
|
||||||
|
#ifdef GL_VERSION_1_1
|
||||||
xglGenTextures(1, &m.texture_id);
|
xglGenTextures(1, &m.texture_id);
|
||||||
xglBindTexture(GL_TEXTURE_2D, 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
|
// set the texture parameters for this texture
|
||||||
xglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ) ;
|
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))
|
if ( (texbuf = read_rgb_texture(fg_tpath, &width, &height))
|
||||||
== NULL ) {
|
== NULL ) {
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT,
|
fgPrintf( FG_GENERAL, FG_EXIT,
|
||||||
"Error in loading texture %s\n", tpath );
|
"Error loading texture %s\n", tpath );
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,6 +255,10 @@ fgMATERIAL_MGR::~fgMATERIAL_MGR ( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $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
|
// Revision 1.5 1998/06/17 21:36:39 curt
|
||||||
// Load and manage multiple textures defined in the Materials library.
|
// Load and manage multiple textures defined in the Materials library.
|
||||||
// Boost max material fagments for each material property to 800.
|
// Boost max material fagments for each material property to 800.
|
||||||
|
|
|
@ -433,7 +433,13 @@ void fgTileMgrRender( void ) {
|
||||||
size = mtl_ptr->list_size;
|
size = mtl_ptr->list_size;
|
||||||
if ( size > 0 ) {
|
if ( size > 0 ) {
|
||||||
if ( o->textures ) {
|
if ( o->textures ) {
|
||||||
|
#ifdef GL_VERSION_1_1
|
||||||
xglBindTexture(GL_TEXTURE_2D, mtl_ptr->texture_id);
|
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 {
|
} else {
|
||||||
xglMaterialfv (GL_FRONT, GL_AMBIENT, mtl_ptr->ambient);
|
xglMaterialfv (GL_FRONT, GL_AMBIENT, mtl_ptr->ambient);
|
||||||
xglMaterialfv (GL_FRONT, GL_DIFFUSE, mtl_ptr->diffuse);
|
xglMaterialfv (GL_FRONT, GL_DIFFUSE, mtl_ptr->diffuse);
|
||||||
|
@ -474,6 +480,10 @@ void fgTileMgrRender( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $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
|
// Revision 1.20 1998/06/17 21:36:42 curt
|
||||||
// Load and manage multiple textures defined in the Materials library.
|
// Load and manage multiple textures defined in the Materials library.
|
||||||
// Boost max material fagments for each material property to 800.
|
// Boost max material fagments for each material property to 800.
|
||||||
|
|
Loading…
Add table
Reference in a new issue