add GetNumTextureUnits()
This commit is contained in:
@@ -181,6 +181,7 @@ public:
|
|||||||
) = 0;
|
) = 0;
|
||||||
virtual void DeleteTexture( unsigned uTexHandle ) = 0;
|
virtual void DeleteTexture( unsigned uTexHandle ) = 0;
|
||||||
virtual void ClearAllTextures() = 0;
|
virtual void ClearAllTextures() = 0;
|
||||||
|
virtual int GetNumTextureUnits() = 0;
|
||||||
virtual void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) = 0;
|
virtual void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) = 0;
|
||||||
virtual void SetTextureModeModulate() = 0;
|
virtual void SetTextureModeModulate() = 0;
|
||||||
virtual void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) = 0;
|
virtual void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) = 0;
|
||||||
|
|||||||
@@ -956,6 +956,11 @@ void RageDisplay_D3D::ClearAllTextures()
|
|||||||
g_iCurrentTextureIndex = 0;
|
g_iCurrentTextureIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int RageDisplay_D3D::GetNumTextureUnits()
|
||||||
|
{
|
||||||
|
return g_DeviceCaps.MaxSimultaneousTextures;
|
||||||
|
}
|
||||||
|
|
||||||
void RageDisplay_D3D::SetTexture( int iTextureUnitIndex, RageTexture* pTexture )
|
void RageDisplay_D3D::SetTexture( int iTextureUnitIndex, RageTexture* pTexture )
|
||||||
{
|
{
|
||||||
g_iCurrentTextureIndex = iTextureUnitIndex;
|
g_iCurrentTextureIndex = iTextureUnitIndex;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public:
|
|||||||
);
|
);
|
||||||
void DeleteTexture( unsigned uTexHandle );
|
void DeleteTexture( unsigned uTexHandle );
|
||||||
void ClearAllTextures();
|
void ClearAllTextures();
|
||||||
|
int GetNumTextureUnits();
|
||||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
||||||
void SetTextureModeModulate();
|
void SetTextureModeModulate();
|
||||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public:
|
|||||||
) { }
|
) { }
|
||||||
void DeleteTexture( unsigned uTexHandle ) { }
|
void DeleteTexture( unsigned uTexHandle ) { }
|
||||||
void ClearAllTextures() { }
|
void ClearAllTextures() { }
|
||||||
|
int GetNumTextureUnits() { return 1; }
|
||||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) { }
|
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) { }
|
||||||
void SetTextureModeModulate() { }
|
void SetTextureModeModulate() { }
|
||||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) { }
|
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) { }
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ int g_glVersion;
|
|||||||
/* GLU version * 10: */
|
/* GLU version * 10: */
|
||||||
int g_gluVersion;
|
int g_gluVersion;
|
||||||
|
|
||||||
|
static int g_iMaxTextureUnits = 0;
|
||||||
|
|
||||||
/* Available extensions: */
|
/* Available extensions: */
|
||||||
set<string> g_glExts;
|
set<string> g_glExts;
|
||||||
|
|
||||||
@@ -379,12 +381,13 @@ CString RageDisplay_OGL::Init( VideoModeParams p, bool bAllowUnacceleratedRender
|
|||||||
return sError;
|
return sError;
|
||||||
|
|
||||||
// Log driver details
|
// Log driver details
|
||||||
LOG->Info("OGL Vendor: %s", glGetString(GL_VENDOR));
|
LOG->Info( "OGL Vendor: %s", glGetString(GL_VENDOR) );
|
||||||
LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER));
|
LOG->Info( "OGL Renderer: %s", glGetString(GL_RENDERER) );
|
||||||
LOG->Info("OGL Version: %s", glGetString(GL_VERSION));
|
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("OGL Max texture size: %i", GetMaxTextureSize() );
|
LOG->Info( "OGL Texture units: %i", g_iMaxTextureUnits );
|
||||||
LOG->Info("GLU Version: %s", gluGetString(GLU_VERSION));
|
LOG->Info( "OGL Extensions: %s", glGetString(GL_EXTENSIONS) );
|
||||||
|
LOG->Info( "GLU Version: %s", gluGetString(GLU_VERSION) );
|
||||||
|
|
||||||
LogGLXDebugInformation();
|
LogGLXDebugInformation();
|
||||||
|
|
||||||
@@ -649,7 +652,11 @@ void SetupExtensions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( HasExtension("GL_ARB_multitexture") )
|
if( HasExtension("GL_ARB_multitexture") )
|
||||||
|
{
|
||||||
GLExt.glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) wind->GetProcAddress("glActiveTextureARB");
|
GLExt.glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) wind->GetProcAddress("glActiveTextureARB");
|
||||||
|
g_iMaxTextureUnits = 1;
|
||||||
|
glGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB, &g_iMaxTextureUnits );
|
||||||
|
}
|
||||||
|
|
||||||
if( HasExtension("GL_ARB_vertex_buffer_object") )
|
if( HasExtension("GL_ARB_vertex_buffer_object") )
|
||||||
{
|
{
|
||||||
@@ -1291,6 +1298,14 @@ void RageDisplay_OGL::ClearAllTextures()
|
|||||||
GLExt.glActiveTextureARB(GL_TEXTURE0_ARB);
|
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 )
|
void RageDisplay_OGL::SetTexture( int iTextureUnitIndex, RageTexture* pTexture )
|
||||||
{
|
{
|
||||||
if( GLExt.glActiveTextureARB == NULL )
|
if( GLExt.glActiveTextureARB == NULL )
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public:
|
|||||||
);
|
);
|
||||||
void DeleteTexture( unsigned uTexHandle );
|
void DeleteTexture( unsigned uTexHandle );
|
||||||
void ClearAllTextures();
|
void ClearAllTextures();
|
||||||
|
int GetNumTextureUnits();
|
||||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
||||||
void SetTextureModeModulate();
|
void SetTextureModeModulate();
|
||||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
||||||
|
|||||||
Reference in New Issue
Block a user