add GetNumTextureUnits()

This commit is contained in:
Glenn Maynard
2005-01-04 05:34:58 +00:00
parent 36a56f51fd
commit a1be0fdb33
6 changed files with 30 additions and 6 deletions
+1
View File
@@ -181,6 +181,7 @@ public:
) = 0;
virtual void DeleteTexture( unsigned uTexHandle ) = 0;
virtual void ClearAllTextures() = 0;
virtual int GetNumTextureUnits() = 0;
virtual void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) = 0;
virtual void SetTextureModeModulate() = 0;
virtual void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) = 0;
+5
View File
@@ -956,6 +956,11 @@ void RageDisplay_D3D::ClearAllTextures()
g_iCurrentTextureIndex = 0;
}
int RageDisplay_D3D::GetNumTextureUnits()
{
return g_DeviceCaps.MaxSimultaneousTextures;
}
void RageDisplay_D3D::SetTexture( int iTextureUnitIndex, RageTexture* pTexture )
{
g_iCurrentTextureIndex = iTextureUnitIndex;
+1
View File
@@ -30,6 +30,7 @@ public:
);
void DeleteTexture( unsigned uTexHandle );
void ClearAllTextures();
int GetNumTextureUnits();
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
void SetTextureModeModulate();
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
+1
View File
@@ -28,6 +28,7 @@ public:
) { }
void DeleteTexture( unsigned uTexHandle ) { }
void ClearAllTextures() { }
int GetNumTextureUnits() { return 1; }
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) { }
void SetTextureModeModulate() { }
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) { }
+21 -6
View File
@@ -106,6 +106,8 @@ int g_glVersion;
/* GLU version * 10: */
int g_gluVersion;
static int g_iMaxTextureUnits = 0;
/* Available extensions: */
set<string> g_glExts;
@@ -379,12 +381,13 @@ CString RageDisplay_OGL::Init( VideoModeParams p, bool bAllowUnacceleratedRender
return sError;
// Log driver details
LOG->Info("OGL Vendor: %s", glGetString(GL_VENDOR));
LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER));
LOG->Info("OGL Version: %s", glGetString(GL_VERSION));
LOG->Info("OGL Extensions: %s", glGetString(GL_EXTENSIONS));
LOG->Info("OGL Max texture size: %i", GetMaxTextureSize() );
LOG->Info("GLU Version: %s", gluGetString(GLU_VERSION));
LOG->Info( "OGL Vendor: %s", glGetString(GL_VENDOR) );
LOG->Info( "OGL Renderer: %s", glGetString(GL_RENDERER) );
LOG->Info( "OGL Version: %s", glGetString(GL_VERSION) );
LOG->Info( "OGL Max texture size: %i", GetMaxTextureSize() );
LOG->Info( "OGL Texture units: %i", g_iMaxTextureUnits );
LOG->Info( "OGL Extensions: %s", glGetString(GL_EXTENSIONS) );
LOG->Info( "GLU Version: %s", gluGetString(GLU_VERSION) );
LogGLXDebugInformation();
@@ -649,7 +652,11 @@ void SetupExtensions()
}
if( HasExtension("GL_ARB_multitexture") )
{
GLExt.glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) wind->GetProcAddress("glActiveTextureARB");
g_iMaxTextureUnits = 1;
glGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB, &g_iMaxTextureUnits );
}
if( HasExtension("GL_ARB_vertex_buffer_object") )
{
@@ -1291,6 +1298,14 @@ void RageDisplay_OGL::ClearAllTextures()
GLExt.glActiveTextureARB(GL_TEXTURE0_ARB);
}
int RageDisplay_OGL::GetNumTextureUnits()
{
if( GLExt.glActiveTextureARB == NULL )
return 1;
else
return g_iMaxTextureUnits;
}
void RageDisplay_OGL::SetTexture( int iTextureUnitIndex, RageTexture* pTexture )
{
if( GLExt.glActiveTextureARB == NULL )
+1
View File
@@ -31,6 +31,7 @@ public:
);
void DeleteTexture( unsigned uTexHandle );
void ClearAllTextures();
int GetNumTextureUnits();
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
void SetTextureModeModulate();
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );