mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 15:46:18 +00:00
Changed: #573 Add anti-aliasing to the OpenGL Driver
This commit is contained in:
parent
b421b38def
commit
bced63993b
2 changed files with 26 additions and 0 deletions
|
@ -94,6 +94,7 @@ void CDriverGLStates::forceDefaults(uint nbStages)
|
|||
_CurLighting= false;
|
||||
_CurZWrite= true;
|
||||
_CurStencilTest=false;
|
||||
_CurMultisample= false;
|
||||
|
||||
// setup GLStates.
|
||||
glDisable(GL_FOG);
|
||||
|
@ -102,6 +103,7 @@ void CDriverGLStates::forceDefaults(uint nbStages)
|
|||
glDisable(GL_ALPHA_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
glDepthMask(GL_TRUE);
|
||||
glDisable(GL_MULTISAMPLE_ARB);
|
||||
|
||||
// Func.
|
||||
_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)
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace NLDRIVERGL {
|
|||
- GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R
|
||||
- GL_COLOR_MATERIAL
|
||||
- GL_FOG
|
||||
- GL_MULTISAMPLE_ARB
|
||||
- glActiveTextureARB()
|
||||
- glClientActiveTextureARB()
|
||||
- glEnableClientState() glDisableClientState() with:
|
||||
|
@ -99,6 +100,9 @@ public:
|
|||
/// enable/disable stencil test
|
||||
void enableStencilTest(bool enable);
|
||||
bool isStencilTestEnabled() const { return _CurStencilTest; }
|
||||
/// enable/disable multisample
|
||||
void enableMultisample(bool enable);
|
||||
bool isMultisampleEnabled() const { return _CurMultisample; }
|
||||
// @}
|
||||
|
||||
/// glBlendFunc.
|
||||
|
@ -197,6 +201,7 @@ private:
|
|||
bool _CurLighting;
|
||||
bool _CurZWrite;
|
||||
bool _CurStencilTest;
|
||||
bool _CurMultisample;
|
||||
|
||||
GLenum _CurBlendSrc;
|
||||
GLenum _CurBlendDst;
|
||||
|
|
Loading…
Reference in a new issue