|
|
@ -299,10 +299,12 @@ void CDriverGLStates3::enableLight(uint num, uint enable)
|
|
|
|
// new state.
|
|
|
|
// new state.
|
|
|
|
_CurLight[num]= enabled;
|
|
|
|
_CurLight[num]= enabled;
|
|
|
|
// Setup GLState.
|
|
|
|
// Setup GLState.
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
if(_CurLight[num])
|
|
|
|
if(_CurLight[num])
|
|
|
|
glEnable ((GLenum)(GL_LIGHT0+num));
|
|
|
|
glEnable ((GLenum)(GL_LIGHT0+num));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
glDisable ((GLenum)(GL_LIGHT0+num));
|
|
|
|
glDisable ((GLenum)(GL_LIGHT0+num));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -424,7 +426,9 @@ void CDriverGLStates3::alphaFunc(float threshold)
|
|
|
|
// new state
|
|
|
|
// new state
|
|
|
|
_CurAlphaTestThreshold= threshold;
|
|
|
|
_CurAlphaTestThreshold= threshold;
|
|
|
|
// setup function.
|
|
|
|
// setup function.
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
glAlphaFunc(GL_GREATER, _CurAlphaTestThreshold);
|
|
|
|
glAlphaFunc(GL_GREATER, _CurAlphaTestThreshold);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -492,7 +496,9 @@ void CDriverGLStates3::setEmissive(uint32 packedColor, const GLfloat color[4])
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_CurEmissive= packedColor;
|
|
|
|
_CurEmissive= packedColor;
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, color);
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, color);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -505,7 +511,9 @@ void CDriverGLStates3::setAmbient(uint32 packedColor, const GLfloat color[4])
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_CurAmbient= packedColor;
|
|
|
|
_CurAmbient= packedColor;
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, color);
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, color);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -518,7 +526,9 @@ void CDriverGLStates3::setDiffuse(uint32 packedColor, const GLfloat color[4])
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_CurDiffuse= packedColor;
|
|
|
|
_CurDiffuse= packedColor;
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, color);
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, color);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -531,7 +541,9 @@ void CDriverGLStates3::setSpecular(uint32 packedColor, const GLfloat color[4])
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_CurSpecular= packedColor;
|
|
|
|
_CurSpecular= packedColor;
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color);
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -544,7 +556,9 @@ void CDriverGLStates3::setShininess(float shin)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_CurShininess= shin;
|
|
|
|
_CurShininess= shin;
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shin);
|
|
|
|
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shin);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -570,6 +584,8 @@ void CDriverGLStates3::setVertexColorLighted(bool enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_VertexColorLighted= enable;
|
|
|
|
_VertexColorLighted= enable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
|
|
|
|
|
|
|
|
if (_VertexColorLighted)
|
|
|
|
if (_VertexColorLighted)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
glEnable (GL_COLOR_MATERIAL);
|
|
|
|
glEnable (GL_COLOR_MATERIAL);
|
|
|
@ -588,6 +604,8 @@ void CDriverGLStates3::setVertexColorLighted(bool enable)
|
|
|
|
convColor(diffCol, glColor);
|
|
|
|
convColor(diffCol, glColor);
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, glColor);
|
|
|
|
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, glColor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -643,6 +661,8 @@ void CDriverGLStates3::setTexGenMode (uint stage, GLint mode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_TexGenMode[stage] = mode;
|
|
|
|
_TexGenMode[stage] = mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
|
|
|
|
|
|
|
|
if (!_TextureCubeMapSupported) return;
|
|
|
|
if (!_TextureCubeMapSupported) return;
|
|
|
|
|
|
|
|
|
|
|
|
if(mode==0)
|
|
|
|
if(mode==0)
|
|
|
@ -680,6 +700,8 @@ void CDriverGLStates3::setTexGenMode (uint stage, GLint mode)
|
|
|
|
glEnable( GL_TEXTURE_GEN_T );
|
|
|
|
glEnable( GL_TEXTURE_GEN_T );
|
|
|
|
glEnable( GL_TEXTURE_GEN_R );
|
|
|
|
glEnable( GL_TEXTURE_GEN_R );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -688,6 +710,8 @@ void CDriverGLStates3::resetTextureMode()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_resetTextureMode);
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_resetTextureMode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
|
|
|
|
|
|
|
|
glDisable(GL_TEXTURE_2D);
|
|
|
|
glDisable(GL_TEXTURE_2D);
|
|
|
|
|
|
|
|
|
|
|
|
if (_TextureCubeMapSupported)
|
|
|
|
if (_TextureCubeMapSupported)
|
|
|
@ -700,6 +724,8 @@ void CDriverGLStates3::resetTextureMode()
|
|
|
|
glDisable(GL_TEXTURE_RECTANGLE_NV);
|
|
|
|
glDisable(GL_TEXTURE_RECTANGLE_NV);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
_TextureMode[_CurrentActiveTextureARB]= TextureDisabled;
|
|
|
|
_TextureMode[_CurrentActiveTextureARB]= TextureDisabled;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -711,6 +737,9 @@ void CDriverGLStates3::setTextureMode(TTextureMode texMode)
|
|
|
|
TTextureMode oldTexMode = _TextureMode[_CurrentActiveTextureARB];
|
|
|
|
TTextureMode oldTexMode = _TextureMode[_CurrentActiveTextureARB];
|
|
|
|
if(oldTexMode != texMode)
|
|
|
|
if(oldTexMode != texMode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
|
|
|
|
|
|
|
|
// Disable first old mode.
|
|
|
|
// Disable first old mode.
|
|
|
|
if (oldTexMode == Texture2D)
|
|
|
|
if (oldTexMode == Texture2D)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -767,6 +796,8 @@ void CDriverGLStates3::setTextureMode(TTextureMode texMode)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// new mode.
|
|
|
|
// new mode.
|
|
|
|
_TextureMode[_CurrentActiveTextureARB]= texMode;
|
|
|
|
_TextureMode[_CurrentActiveTextureARB]= texMode;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -799,6 +830,8 @@ void CDriverGLStates3::forceActiveTextureARB(uint stage)
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CDriverGLStates3::enableVertexArray(bool enable)
|
|
|
|
void CDriverGLStates3::enableVertexArray(bool enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
|
|
|
|
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableVertexArray);
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableVertexArray);
|
|
|
|
|
|
|
|
|
|
|
|
if(_VertexArrayEnabled != enable)
|
|
|
|
if(_VertexArrayEnabled != enable)
|
|
|
@ -810,10 +843,15 @@ void CDriverGLStates3::enableVertexArray(bool enable)
|
|
|
|
|
|
|
|
|
|
|
|
_VertexArrayEnabled= enable;
|
|
|
|
_VertexArrayEnabled= enable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CDriverGLStates3::enableNormalArray(bool enable)
|
|
|
|
void CDriverGLStates3::enableNormalArray(bool enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
|
|
|
|
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableNormalArray)
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableNormalArray)
|
|
|
|
if(_NormalArrayEnabled != enable)
|
|
|
|
if(_NormalArrayEnabled != enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -825,10 +863,14 @@ void CDriverGLStates3::enableNormalArray(bool enable)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CDriverGLStates3::enableWeightArray(bool enable)
|
|
|
|
void CDriverGLStates3::enableWeightArray(bool enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableWeightArray);
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableWeightArray);
|
|
|
|
|
|
|
|
|
|
|
|
if(_WeightArrayEnabled != enable)
|
|
|
|
if(_WeightArrayEnabled != enable)
|
|
|
@ -840,10 +882,13 @@ void CDriverGLStates3::enableWeightArray(bool enable)
|
|
|
|
|
|
|
|
|
|
|
|
_WeightArrayEnabled= enable;
|
|
|
|
_WeightArrayEnabled= enable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CDriverGLStates3::enableColorArray(bool enable)
|
|
|
|
void CDriverGLStates3::enableColorArray(bool enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableColorArray);
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableColorArray);
|
|
|
|
|
|
|
|
|
|
|
|
if(_ColorArrayEnabled != enable)
|
|
|
|
if(_ColorArrayEnabled != enable)
|
|
|
@ -856,12 +901,15 @@ void CDriverGLStates3::enableColorArray(bool enable)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CDriverGLStates3::enableSecondaryColorArray(bool enable)
|
|
|
|
void CDriverGLStates3::enableSecondaryColorArray(bool enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableSecondaryColorArray);
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableSecondaryColorArray);
|
|
|
|
|
|
|
|
|
|
|
|
if(_SecondaryColorArrayEnabled != enable)
|
|
|
|
if(_SecondaryColorArrayEnabled != enable)
|
|
|
@ -880,11 +928,14 @@ void CDriverGLStates3::enableSecondaryColorArray(bool enable)
|
|
|
|
nglSecondaryColor3ubEXT(0,0,0);
|
|
|
|
nglSecondaryColor3ubEXT(0,0,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CDriverGLStates3::clientActiveTextureARB(uint stage)
|
|
|
|
void CDriverGLStates3::clientActiveTextureARB(uint stage)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_clientActiveTextureARB);
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_clientActiveTextureARB);
|
|
|
|
|
|
|
|
|
|
|
|
if( _CurrentClientActiveTextureARB != stage )
|
|
|
|
if( _CurrentClientActiveTextureARB != stage )
|
|
|
@ -892,11 +943,14 @@ void CDriverGLStates3::clientActiveTextureARB(uint stage)
|
|
|
|
nglClientActiveTextureARB(GL_TEXTURE0_ARB+stage);
|
|
|
|
nglClientActiveTextureARB(GL_TEXTURE0_ARB+stage);
|
|
|
|
_CurrentClientActiveTextureARB= stage;
|
|
|
|
_CurrentClientActiveTextureARB= stage;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CDriverGLStates3::enableTexCoordArray(bool enable)
|
|
|
|
void CDriverGLStates3::enableTexCoordArray(bool enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableTexCoordArray);
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableTexCoordArray);
|
|
|
|
|
|
|
|
|
|
|
|
if(_TexCoordArrayEnabled[_CurrentClientActiveTextureARB] != enable)
|
|
|
|
if(_TexCoordArrayEnabled[_CurrentClientActiveTextureARB] != enable)
|
|
|
@ -909,11 +963,14 @@ void CDriverGLStates3::enableTexCoordArray(bool enable)
|
|
|
|
|
|
|
|
|
|
|
|
_TexCoordArrayEnabled[_CurrentClientActiveTextureARB]= enable;
|
|
|
|
_TexCoordArrayEnabled[_CurrentClientActiveTextureARB]= enable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CDriverGLStates3::enableVertexAttribArray(uint glIndex, bool enable)
|
|
|
|
void CDriverGLStates3::enableVertexAttribArray(uint glIndex, bool enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableVertexAttribArray);
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableVertexAttribArray);
|
|
|
|
|
|
|
|
|
|
|
|
if(_VertexAttribArrayEnabled[glIndex] != enable)
|
|
|
|
if(_VertexAttribArrayEnabled[glIndex] != enable)
|
|
|
@ -924,6 +981,7 @@ void CDriverGLStates3::enableVertexAttribArray(uint glIndex, bool enable)
|
|
|
|
glDisableClientState(glIndex+GL_VERTEX_ATTRIB_ARRAY0_NV);
|
|
|
|
glDisableClientState(glIndex+GL_VERTEX_ATTRIB_ARRAY0_NV);
|
|
|
|
_VertexAttribArrayEnabled[glIndex]= enable;
|
|
|
|
_VertexAttribArrayEnabled[glIndex]= enable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
@ -956,11 +1014,13 @@ void CDriverGLStates3::enableFog(uint enable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// new state.
|
|
|
|
// new state.
|
|
|
|
_CurFog= enabled;
|
|
|
|
_CurFog= enabled;
|
|
|
|
|
|
|
|
#ifndef GLSL
|
|
|
|
// Setup GLState.
|
|
|
|
// Setup GLState.
|
|
|
|
if(_CurFog)
|
|
|
|
if(_CurFog)
|
|
|
|
glEnable(GL_FOG);
|
|
|
|
glEnable(GL_FOG);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
glDisable(GL_FOG);
|
|
|
|
glDisable(GL_FOG);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|