Changed: #573 Add anti-aliasing to the OpenGL Driver

This commit is contained in:
kervala 2012-10-17 11:05:51 +02:00
parent b421b38def
commit bced63993b
2 changed files with 26 additions and 0 deletions

View file

@ -94,6 +94,7 @@ void CDriverGLStates::forceDefaults(uint nbStages)
_CurLighting= false; _CurLighting= false;
_CurZWrite= true; _CurZWrite= true;
_CurStencilTest=false; _CurStencilTest=false;
_CurMultisample= false;
// setup GLStates. // setup GLStates.
glDisable(GL_FOG); glDisable(GL_FOG);
@ -102,6 +103,7 @@ void CDriverGLStates::forceDefaults(uint nbStages)
glDisable(GL_ALPHA_TEST); glDisable(GL_ALPHA_TEST);
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glDisable(GL_MULTISAMPLE_ARB);
// Func. // Func.
_CurBlendSrc= GL_SRC_ALPHA; _CurBlendSrc= GL_SRC_ALPHA;
@ -379,6 +381,25 @@ void CDriverGLStates::enableStencilTest(bool enable)
} }
} }
// ***************************************************************************
void CDriverGLStates::enableMultisample(bool enable)
{
H_AUTO_OGL(CDriverGLStates_enableMultisample);
// If different from current setup, update.
#ifndef NL3D_GLSTATE_DISABLE_CACHE
if( enable != _CurMultisample )
#endif
{
// new state.
_CurMultisample= enable;
// Setup GLState.
if(_CurMultisample)
glEnable(GL_MULTISAMPLE_ARB);
else
glDisable(GL_MULTISAMPLE_ARB);
}
}
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::blendFunc(GLenum src, GLenum dst) void CDriverGLStates::blendFunc(GLenum src, GLenum dst)

View file

@ -44,6 +44,7 @@ namespace NLDRIVERGL {
- GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R - GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R
- GL_COLOR_MATERIAL - GL_COLOR_MATERIAL
- GL_FOG - GL_FOG
- GL_MULTISAMPLE_ARB
- glActiveTextureARB() - glActiveTextureARB()
- glClientActiveTextureARB() - glClientActiveTextureARB()
- glEnableClientState() glDisableClientState() with: - glEnableClientState() glDisableClientState() with:
@ -99,6 +100,9 @@ public:
/// enable/disable stencil test /// enable/disable stencil test
void enableStencilTest(bool enable); void enableStencilTest(bool enable);
bool isStencilTestEnabled() const { return _CurStencilTest; } bool isStencilTestEnabled() const { return _CurStencilTest; }
/// enable/disable multisample
void enableMultisample(bool enable);
bool isMultisampleEnabled() const { return _CurMultisample; }
// @} // @}
/// glBlendFunc. /// glBlendFunc.
@ -197,6 +201,7 @@ private:
bool _CurLighting; bool _CurLighting;
bool _CurZWrite; bool _CurZWrite;
bool _CurStencilTest; bool _CurStencilTest;
bool _CurMultisample;
GLenum _CurBlendSrc; GLenum _CurBlendSrc;
GLenum _CurBlendDst; GLenum _CurBlendDst;