|
|
|
@ -63,11 +63,6 @@ void CDriverGLStates3::init()
|
|
|
|
|
_DepthRangeNear = 0.f;
|
|
|
|
|
_DepthRangeFar = 1.f;
|
|
|
|
|
_ZBias = 0.f;
|
|
|
|
|
// by default all lights are disabled (not reseted in forceDefaults)
|
|
|
|
|
for (i=0; i<MaxLight; i++)
|
|
|
|
|
{
|
|
|
|
|
_CurLight[i]= false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -81,7 +76,6 @@ void CDriverGLStates3::forceDefaults(uint nbStages)
|
|
|
|
|
_CurBlend = false;
|
|
|
|
|
_CurCullFace = true;
|
|
|
|
|
_CurAlphaTest = false;
|
|
|
|
|
_CurLighting= false;
|
|
|
|
|
_CurZWrite = true;
|
|
|
|
|
_CurStencilTest =false;
|
|
|
|
|
|
|
|
|
@ -90,7 +84,6 @@ void CDriverGLStates3::forceDefaults(uint nbStages)
|
|
|
|
|
glDisable(GL_BLEND);
|
|
|
|
|
glEnable(GL_CULL_FACE);
|
|
|
|
|
glDisable(GL_ALPHA_TEST);
|
|
|
|
|
glDisable(GL_LIGHTING);
|
|
|
|
|
glDepthMask(GL_TRUE);
|
|
|
|
|
|
|
|
|
|
// Func.
|
|
|
|
@ -131,8 +124,7 @@ void CDriverGLStates3::forceDefaults(uint nbStages)
|
|
|
|
|
static const GLfloat zero[4] = { 0, 0, 0, 1 };
|
|
|
|
|
|
|
|
|
|
// TexModes
|
|
|
|
|
uint stage;
|
|
|
|
|
for (stage=0;stage<nbStages; stage++)
|
|
|
|
|
for (uint stage = 0; stage < nbStages; ++stage)
|
|
|
|
|
{
|
|
|
|
|
// disable texturing.
|
|
|
|
|
nglActiveTexture(GL_TEXTURE0 + stage);
|
|
|
|
@ -236,52 +228,6 @@ void CDriverGLStates3::enableAlphaTest(uint enable)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CDriverGLStates3::enableLighting(uint enable)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableLighting)
|
|
|
|
|
// If different from current setup, update.
|
|
|
|
|
bool enabled= (enable!=0);
|
|
|
|
|
#ifndef NL3D_GLSTATE_DISABLE_CACHE
|
|
|
|
|
if (enabled != _CurLighting)
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
// new state.
|
|
|
|
|
_CurLighting= enabled;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CDriverGLStates3::enableLight(uint num, uint enable)
|
|
|
|
|
{
|
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_enableLight)
|
|
|
|
|
if (num >= MaxLight)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// If different from current setup, update.
|
|
|
|
|
bool enabled= (enable!=0);
|
|
|
|
|
#ifndef NL3D_GLSTATE_DISABLE_CACHE
|
|
|
|
|
if (enabled != _CurLight[num])
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
// new state.
|
|
|
|
|
_CurLight[num]= enabled;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
bool CDriverGLStates3::isLightEnabled(uint num) const
|
|
|
|
|
{
|
|
|
|
|
H_AUTO_OGL(CDriverGLStates3_isLightEnabled)
|
|
|
|
|
if (num >= MaxLight)
|
|
|
|
|
return false;
|
|
|
|
|
else
|
|
|
|
|
return _CurLight[num];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CDriverGLStates3::enableZWrite(uint enable)
|
|
|
|
|
{
|
|
|
|
|