- renamed some stuff that clashed with gl function names.

This commit is contained in:
Christoph Oelckers 2014-07-27 12:33:54 +02:00
parent 77d9d9b2a5
commit c1d8f235c2
3 changed files with 25 additions and 25 deletions

View File

@ -40,7 +40,7 @@ VSMatrix::setIdentityMatrix( FLOATTYPE *mat, int size) {
// glLoadIdentity implementation // gl LoadIdentity implementation
void void
VSMatrix::loadIdentity() VSMatrix::loadIdentity()
{ {
@ -54,7 +54,7 @@ VSMatrix::loadIdentity()
} }
// glMultMatrix implementation // gl MultMatrix implementation
void void
VSMatrix::multMatrix(const FLOATTYPE *aMatrix) VSMatrix::multMatrix(const FLOATTYPE *aMatrix)
{ {
@ -76,7 +76,7 @@ VSMatrix::multMatrix(const FLOATTYPE *aMatrix)
} }
#ifdef USE_DOUBLE #ifdef USE_DOUBLE
// glMultMatrix implementation // gl MultMatrix implementation
void void
VSMatrix::multMatrix(const float *aMatrix) VSMatrix::multMatrix(const float *aMatrix)
{ {
@ -100,7 +100,7 @@ VSMatrix::multMatrix(const float *aMatrix)
// glLoadMatrix implementation // gl LoadMatrix implementation
void void
VSMatrix::loadMatrix(const FLOATTYPE *aMatrix) VSMatrix::loadMatrix(const FLOATTYPE *aMatrix)
{ {
@ -108,7 +108,7 @@ VSMatrix::loadMatrix(const FLOATTYPE *aMatrix)
} }
#ifdef USE_DOUBLE #ifdef USE_DOUBLE
// glLoadMatrix implementation // gl LoadMatrix implementation
void void
VSMatrix::loadMatrix(const float *aMatrix) VSMatrix::loadMatrix(const float *aMatrix)
{ {
@ -265,7 +265,7 @@ VSMatrix::perspective(FLOATTYPE fov, FLOATTYPE ratio, FLOATTYPE nearp, FLOATTYPE
} }
// glOrtho implementation // gl Ortho implementation
void void
VSMatrix::ortho(FLOATTYPE left, FLOATTYPE right, VSMatrix::ortho(FLOATTYPE left, FLOATTYPE right,
FLOATTYPE bottom, FLOATTYPE top, FLOATTYPE bottom, FLOATTYPE top,
@ -282,7 +282,7 @@ VSMatrix::ortho(FLOATTYPE left, FLOATTYPE right,
} }
// glFrustum implementation // gl Frustum implementation
void void
VSMatrix::frustum(FLOATTYPE left, FLOATTYPE right, VSMatrix::frustum(FLOATTYPE left, FLOATTYPE right,
FLOATTYPE bottom, FLOATTYPE top, FLOATTYPE bottom, FLOATTYPE top,

View File

@ -74,11 +74,9 @@ void FRenderState::Reset()
mDesaturation = 0; mDesaturation = 0;
mSrcBlend = GL_SRC_ALPHA; mSrcBlend = GL_SRC_ALPHA;
mDstBlend = GL_ONE_MINUS_SRC_ALPHA; mDstBlend = GL_ONE_MINUS_SRC_ALPHA;
glSrcBlend = glDstBlend = -1;
mAlphaThreshold = 0.5f; mAlphaThreshold = 0.5f;
mBlendEquation = GL_FUNC_ADD; mBlendEquation = GL_FUNC_ADD;
mObjectColor = 0xffffffff; mObjectColor = 0xffffffff;
glBlendEquation = -1;
m2D = true; m2D = true;
mVertexBuffer = mCurrentVertexBuffer = NULL; mVertexBuffer = mCurrentVertexBuffer = NULL;
mColormapState = CM_DEFAULT; mColormapState = CM_DEFAULT;
@ -86,6 +84,10 @@ void FRenderState::Reset()
mSpecialEffect = EFF_NONE; mSpecialEffect = EFF_NONE;
mClipHeightTop = 65536.f; mClipHeightTop = 65536.f;
mClipHeightBottom = -65536.f; mClipHeightBottom = -65536.f;
stSrcBlend = stDstBlend = -1;
stBlendEquation = -1;
stAlphaThreshold = -1.f;
} }
//========================================================================== //==========================================================================
@ -140,9 +142,9 @@ bool FRenderState::ApplyShader()
#ifndef CORE_PROFILE #ifndef CORE_PROFILE
if (!(gl.flags & RFL_COREPROFILE)) if (!(gl.flags & RFL_COREPROFILE))
{ {
if (mAlphaThreshold != glAlphaThreshold) if (mAlphaThreshold != stAlphaThreshold)
{ {
glAlphaThreshold = mAlphaThreshold; stAlphaThreshold = mAlphaThreshold;
if (mAlphaThreshold < 0.f) if (mAlphaThreshold < 0.f)
{ {
glDisable(GL_ALPHA_TEST); glDisable(GL_ALPHA_TEST);
@ -150,7 +152,7 @@ bool FRenderState::ApplyShader()
else else
{ {
glEnable(GL_ALPHA_TEST); glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, mAlphaThreshold); glAlphaFunc(GL_GREATER, mAlphaThreshold * mColor.vec[3]);
} }
} }
} }
@ -271,16 +273,16 @@ void FRenderState::Apply()
{ {
if (!gl_direct_state_change) if (!gl_direct_state_change)
{ {
if (mSrcBlend != glSrcBlend || mDstBlend != glDstBlend) if (mSrcBlend != stSrcBlend || mDstBlend != stDstBlend)
{ {
glSrcBlend = mSrcBlend; stSrcBlend = mSrcBlend;
glDstBlend = mDstBlend; stDstBlend = mDstBlend;
glBlendFunc(mSrcBlend, mDstBlend); glBlendFunc(mSrcBlend, mDstBlend);
} }
if (mBlendEquation != glBlendEquation) if (mBlendEquation != stBlendEquation)
{ {
glBlendEquation = mBlendEquation; stBlendEquation = mBlendEquation;
::glBlendEquation(mBlendEquation); glBlendEquation(mBlendEquation);
} }
} }

View File

@ -75,12 +75,10 @@ class FRenderState
int mEffectState; int mEffectState;
int mColormapState; int mColormapState;
float glAlphaThreshold; float stAlphaThreshold;
bool glClipOn; int stSrcBlend, stDstBlend;
bool stAlphaTest;
int glSrcBlend, glDstBlend; int stBlendEquation;
bool glAlphaTest;
int glBlendEquation;
bool ApplyShader(); bool ApplyShader();
@ -299,7 +297,7 @@ public:
} }
else else
{ {
::glBlendEquation(eq); glBlendEquation(eq);
} }
} }