From d55a0953de0d1a203f92f6b905d76ccd78ba2492 Mon Sep 17 00:00:00 2001 From: Nicolas Capens Date: Mon, 3 Aug 2015 16:36:58 -0400 Subject: [PATCH] Renamed boolean state variables and setters. Change-Id: Ied1be6434a356ec7315df9d728dc424961f44fd0 Reviewed-on: https://swiftshader-review.googlesource.com/3770 Reviewed-by: Nicolas Capens Tested-by: Nicolas Capens --- src/OpenGL/libGL/Context.cpp | 182 +++++++++++++++++------------------ src/OpenGL/libGL/Context.h | 56 +++++------ src/OpenGL/libGL/libGL.cpp | 116 +++++++++++----------- src/OpenGL/libGLES_CM/Context.cpp | 166 ++++++++++++++++---------------- src/OpenGL/libGLES_CM/Context.h | 56 +++++------ src/OpenGL/libGLES_CM/libGLES_CM.cpp | 128 ++++++++++++------------ src/OpenGL/libGLESv2/Context.cpp | 166 ++++++++++++++++---------------- src/OpenGL/libGLESv2/Context.h | 52 +++++----- src/OpenGL/libGLESv2/libGLESv2.cpp | 48 ++++----- 9 files changed, 486 insertions(+), 484 deletions(-) diff --git a/src/OpenGL/libGL/Context.cpp b/src/OpenGL/libGL/Context.cpp index bd9b06dd3..8d0aebad8 100644 --- a/src/OpenGL/libGL/Context.cpp +++ b/src/OpenGL/libGL/Context.cpp @@ -56,12 +56,12 @@ Context::Context(const Context *shareContext) mState.depthClearValue = 1.0f; mState.stencilClearValue = 0; - mState.cullFace = false; + mState.cullFaceEnabled = false; mState.cullMode = GL_BACK; mState.frontFace = GL_CCW; - mState.depthTest = false; + mState.depthTestEnabled = false; mState.depthFunc = GL_LESS; - mState.blend = false; + mState.blendEnabled = false; mState.sourceBlendRGB = GL_ONE; mState.sourceBlendAlpha = GL_ONE; mState.destBlendRGB = GL_ZERO; @@ -72,7 +72,7 @@ Context::Context(const Context *shareContext) mState.blendColor.green = 0; mState.blendColor.blue = 0; mState.blendColor.alpha = 0; - mState.stencilTest = false; + mState.stencilTestEnabled = false; mState.stencilFunc = GL_ALWAYS; mState.stencilRef = 0; mState.stencilMask = -1; @@ -87,18 +87,18 @@ Context::Context(const Context *shareContext) mState.stencilBackFail = GL_KEEP; mState.stencilBackPassDepthFail = GL_KEEP; mState.stencilBackPassDepthPass = GL_KEEP; - mState.polygonOffsetFill = false; + mState.polygonOffsetFillEnabled = false; mState.polygonOffsetFactor = 0.0f; mState.polygonOffsetUnits = 0.0f; - mState.sampleAlphaToCoverage = false; - mState.sampleCoverage = false; + mState.sampleAlphaToCoverageEnabled = false; + mState.sampleCoverageEnabled = false; mState.sampleCoverageValue = 1.0f; mState.sampleCoverageInvert = false; - mState.scissorTest = false; - mState.dither = true; + mState.scissorTestEnabled = false; + mState.ditherEnabled = true; mState.generateMipmapHint = GL_DONT_CARE; mState.fragmentShaderDerivativeHint = GL_DONT_CARE; - mState.colorLogicOp = false; + mState.colorLogicOpEnabled = false; mState.logicalOperation = GL_COPY; mState.lineWidth = 1.0f; @@ -339,14 +339,14 @@ void Context::setClearStencil(int stencil) mState.stencilClearValue = stencil; } -void Context::setCullFace(bool enabled) +void Context::setCullFaceEnabled(bool enabled) { - mState.cullFace = enabled; + mState.cullFaceEnabled = enabled; } bool Context::isCullFaceEnabled() const { - return mState.cullFace; + return mState.cullFaceEnabled; } void Context::setCullMode(GLenum mode) @@ -363,18 +363,18 @@ void Context::setFrontFace(GLenum front) } } -void Context::setDepthTest(bool enabled) +void Context::setDepthTestEnabled(bool enabled) { - if(mState.depthTest != enabled) + if(mState.depthTestEnabled != enabled) { - mState.depthTest = enabled; + mState.depthTestEnabled = enabled; mDepthStateDirty = true; } } bool Context::isDepthTestEnabled() const { - return mState.depthTest; + return mState.depthTestEnabled; } void Context::setDepthFunc(GLenum depthFunc) @@ -392,18 +392,18 @@ void Context::setDepthRange(float zNear, float zFar) mState.zFar = zFar; } -void Context::setBlend(bool enabled) +void Context::setBlendEnabled(bool enabled) { - if(mState.blend != enabled) + if(mState.blendEnabled != enabled) { - mState.blend = enabled; + mState.blendEnabled = enabled; mBlendStateDirty = true; } } bool Context::isBlendEnabled() const { - return mState.blend; + return mState.blendEnabled; } void Context::setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha) @@ -447,25 +447,25 @@ void Context::setBlendEquation(GLenum rgbEquation, GLenum alphaEquation) } } -void Context::setStencilTest(bool enabled) +void Context::setStencilTestEnabled(bool enabled) { - if(mState.stencilTest != enabled) + if(mState.stencilTestEnabled != enabled) { - mState.stencilTest = enabled; + mState.stencilTestEnabled = enabled; mStencilStateDirty = true; } } bool Context::isStencilTestEnabled() const { - return mState.stencilTest; + return mState.stencilTestEnabled; } void Context::setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask) { if(mState.stencilFunc != stencilFunc || - mState.stencilRef != stencilRef || - mState.stencilMask != stencilMask) + mState.stencilRef != stencilRef || + mState.stencilMask != stencilMask) { mState.stencilFunc = stencilFunc; mState.stencilRef = (stencilRef > 0) ? stencilRef : 0; @@ -477,8 +477,8 @@ void Context::setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint sten void Context::setStencilBackParams(GLenum stencilBackFunc, GLint stencilBackRef, GLuint stencilBackMask) { if(mState.stencilBackFunc != stencilBackFunc || - mState.stencilBackRef != stencilBackRef || - mState.stencilBackMask != stencilBackMask) + mState.stencilBackRef != stencilBackRef || + mState.stencilBackMask != stencilBackMask) { mState.stencilBackFunc = stencilBackFunc; mState.stencilBackRef = (stencilBackRef > 0) ? stencilBackRef : 0; @@ -508,8 +508,8 @@ void Context::setStencilBackWritemask(GLuint stencilBackWritemask) void Context::setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass) { if(mState.stencilFail != stencilFail || - mState.stencilPassDepthFail != stencilPassDepthFail || - mState.stencilPassDepthPass != stencilPassDepthPass) + mState.stencilPassDepthFail != stencilPassDepthFail || + mState.stencilPassDepthPass != stencilPassDepthPass) { mState.stencilFail = stencilFail; mState.stencilPassDepthFail = stencilPassDepthFail; @@ -521,8 +521,8 @@ void Context::setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFa void Context::setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBackPassDepthFail, GLenum stencilBackPassDepthPass) { if(mState.stencilBackFail != stencilBackFail || - mState.stencilBackPassDepthFail != stencilBackPassDepthFail || - mState.stencilBackPassDepthPass != stencilBackPassDepthPass) + mState.stencilBackPassDepthFail != stencilBackPassDepthFail || + mState.stencilBackPassDepthPass != stencilBackPassDepthPass) { mState.stencilBackFail = stencilBackFail; mState.stencilBackPassDepthFail = stencilBackPassDepthFail; @@ -531,24 +531,24 @@ void Context::setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBac } } -void Context::setPolygonOffsetFill(bool enabled) +void Context::setPolygonOffsetFillEnabled(bool enabled) { - if(mState.polygonOffsetFill != enabled) + if(mState.polygonOffsetFillEnabled != enabled) { - mState.polygonOffsetFill = enabled; + mState.polygonOffsetFillEnabled = enabled; mPolygonOffsetStateDirty = true; } } bool Context::isPolygonOffsetFillEnabled() const { - return mState.polygonOffsetFill; + return mState.polygonOffsetFillEnabled; } void Context::setPolygonOffsetParams(GLfloat factor, GLfloat units) { if(mState.polygonOffsetFactor != factor || - mState.polygonOffsetUnits != units) + mState.polygonOffsetUnits != units) { mState.polygonOffsetFactor = factor; mState.polygonOffsetUnits = units; @@ -556,32 +556,32 @@ void Context::setPolygonOffsetParams(GLfloat factor, GLfloat units) } } -void Context::setSampleAlphaToCoverage(bool enabled) +void Context::setSampleAlphaToCoverageEnabled(bool enabled) { - if(mState.sampleAlphaToCoverage != enabled) + if(mState.sampleAlphaToCoverageEnabled != enabled) { - mState.sampleAlphaToCoverage = enabled; + mState.sampleAlphaToCoverageEnabled = enabled; mSampleStateDirty = true; } } bool Context::isSampleAlphaToCoverageEnabled() const { - return mState.sampleAlphaToCoverage; + return mState.sampleAlphaToCoverageEnabled; } -void Context::setSampleCoverage(bool enabled) +void Context::setSampleCoverageEnabled(bool enabled) { - if(mState.sampleCoverage != enabled) + if(mState.sampleCoverageEnabled != enabled) { - mState.sampleCoverage = enabled; + mState.sampleCoverageEnabled = enabled; mSampleStateDirty = true; } } bool Context::isSampleCoverageEnabled() const { - return mState.sampleCoverage; + return mState.sampleCoverageEnabled; } void Context::setSampleCoverageParams(GLclampf value, bool invert) @@ -595,28 +595,28 @@ void Context::setSampleCoverageParams(GLclampf value, bool invert) } } -void Context::setScissorTest(bool enabled) +void Context::setScissorTestEnabled(bool enabled) { - mState.scissorTest = enabled; + mState.scissorTestEnabled = enabled; } bool Context::isScissorTestEnabled() const { - return mState.scissorTest; + return mState.scissorTestEnabled; } -void Context::setDither(bool enabled) +void Context::setDitherEnabled(bool enabled) { - if(mState.dither != enabled) + if(mState.ditherEnabled != enabled) { - mState.dither = enabled; + mState.ditherEnabled = enabled; mDitherStateDirty = true; } } bool Context::isDitherEnabled() const { - return mState.dither; + return mState.ditherEnabled; } void Context::setLineWidth(GLfloat width) @@ -725,7 +725,7 @@ GLuint Context::getActiveQuery(GLenum target) const return 0; } -void Context::setEnableVertexAttribArray(unsigned int attribNum, bool enabled) +void Context::setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled) { mState.vertexAttribute[attribNum].mArrayEnabled = enabled; } @@ -1247,25 +1247,25 @@ bool Context::getBooleanv(GLenum pname, GLboolean *params) { switch (pname) { - case GL_SHADER_COMPILER: *params = GL_TRUE; break; - case GL_SAMPLE_COVERAGE_INVERT: *params = mState.sampleCoverageInvert; break; - case GL_DEPTH_WRITEMASK: *params = mState.depthMask; break; - case GL_COLOR_WRITEMASK: + case GL_SHADER_COMPILER: *params = GL_TRUE; break; + case GL_SAMPLE_COVERAGE_INVERT: *params = mState.sampleCoverageInvert; break; + case GL_DEPTH_WRITEMASK: *params = mState.depthMask; break; + case GL_COLOR_WRITEMASK: params[0] = mState.colorMaskRed; params[1] = mState.colorMaskGreen; params[2] = mState.colorMaskBlue; params[3] = mState.colorMaskAlpha; break; - case GL_CULL_FACE: *params = mState.cullFace; break; - case GL_POLYGON_OFFSET_FILL: *params = mState.polygonOffsetFill; break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: *params = mState.sampleAlphaToCoverage; break; - case GL_SAMPLE_COVERAGE: *params = mState.sampleCoverage; break; - case GL_SCISSOR_TEST: *params = mState.scissorTest; break; - case GL_STENCIL_TEST: *params = mState.stencilTest; break; - case GL_DEPTH_TEST: *params = mState.depthTest; break; - case GL_BLEND: *params = mState.blend; break; - case GL_DITHER: *params = mState.dither; break; - default: + case GL_CULL_FACE: *params = mState.cullFaceEnabled; break; + case GL_POLYGON_OFFSET_FILL: *params = mState.polygonOffsetFillEnabled; break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: *params = mState.sampleAlphaToCoverageEnabled; break; + case GL_SAMPLE_COVERAGE: *params = mState.sampleCoverageEnabled; break; + case GL_SCISSOR_TEST: *params = mState.scissorTestEnabled; break; + case GL_STENCIL_TEST: *params = mState.stencilTestEnabled; break; + case GL_DEPTH_TEST: *params = mState.depthTestEnabled; break; + case GL_BLEND: *params = mState.blendEnabled; break; + case GL_DITHER: *params = mState.ditherEnabled; break; + default: return false; } @@ -1737,7 +1737,7 @@ bool Context::applyRenderTarget() device->setViewport(viewport); - if(mState.scissorTest) + if(mState.scissorTestEnabled) { sw::Rect scissor = {mState.scissorX, mState.scissorY, mState.scissorX + mState.scissorWidth, mState.scissorY + mState.scissorHeight}; scissor.clip(0, 0, width, height); @@ -1768,7 +1768,7 @@ void Context::applyState(GLenum drawMode) { Framebuffer *framebuffer = getDrawFramebuffer(); - if(mState.cullFace) + if(mState.cullFaceEnabled) { device->setCullMode(es2sw::ConvertCullMode(mState.cullMode, mState.frontFace)); } @@ -1779,7 +1779,7 @@ void Context::applyState(GLenum drawMode) if(mDepthStateDirty) { - if(mState.depthTest) + if(mState.depthTestEnabled) { device->setDepthBufferEnable(true); device->setDepthCompare(es2sw::ConvertDepthComparison(mState.depthFunc)); @@ -1794,7 +1794,7 @@ void Context::applyState(GLenum drawMode) if(mBlendStateDirty) { - if(mState.blend) + if(mState.blendEnabled) { device->setAlphaBlendEnable(true); device->setSeparateAlphaBlendEnable(true); @@ -1819,7 +1819,7 @@ void Context::applyState(GLenum drawMode) if(mColorLogicOperatorDirty) { - if(mState.colorLogicOp) + if(mState.colorLogicOpEnabled) { device->setColorLogicOpEnabled(true); device->setLogicalOperation(es2sw::ConvertLogicalOperation(mState.logicalOperation)); @@ -1834,7 +1834,7 @@ void Context::applyState(GLenum drawMode) if(mStencilStateDirty || mFrontFaceDirty) { - if(mState.stencilTest && framebuffer->hasStencil()) + if(mState.stencilTestEnabled && framebuffer->hasStencil()) { device->setStencilEnable(true); device->setTwoSidedStencil(true); @@ -1915,7 +1915,7 @@ void Context::applyState(GLenum drawMode) if(mPolygonOffsetStateDirty) { - if(mState.polygonOffsetFill) + if(mState.polygonOffsetFillEnabled) { Renderbuffer *depthbuffer = framebuffer->getDepthbuffer(); if(depthbuffer) @@ -1936,7 +1936,7 @@ void Context::applyState(GLenum drawMode) if(mSampleStateDirty) { - if(mState.sampleAlphaToCoverage) + if(mState.sampleAlphaToCoverageEnabled) { device->setTransparencyAntialiasing(sw::TRANSPARENCY_ALPHA_TO_COVERAGE); } @@ -1945,7 +1945,7 @@ void Context::applyState(GLenum drawMode) device->setTransparencyAntialiasing(sw::TRANSPARENCY_NONE); } - if(mState.sampleCoverage) + if(mState.sampleCoverageEnabled) { unsigned int mask = 0; if(mState.sampleCoverageValue != 0) @@ -2803,7 +2803,7 @@ void Context::detachRenderbuffer(GLuint renderbuffer) bool Context::cullSkipsDraw(GLenum drawMode) { - return mState.cullFace && mState.cullMode == GL_FRONT_AND_BACK && isTriangleMode(drawMode); + return mState.cullFaceEnabled && mState.cullMode == GL_FRONT_AND_BACK && isTriangleMode(drawMode); } bool Context::isTriangleMode(GLenum drawMode) @@ -2894,7 +2894,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 sw::Rect sourceScissoredRect = sourceRect; sw::Rect destScissoredRect = destRect; - if(mState.scissorTest) // Only write to parts of the destination framebuffer which pass the scissor test + if(mState.scissorTestEnabled) // Only write to parts of the destination framebuffer which pass the scissor test { if(destRect.x0 < mState.scissorX) { @@ -3228,7 +3228,7 @@ void Context::ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top currentMatrixStack().ortho(left, right, bottom, top, zNear, zFar); } -void Context::setLighting(bool enable) +void Context::setLightingEnabled(bool enable) { if(drawing) { @@ -3238,7 +3238,7 @@ void Context::setLighting(bool enable) device->setLightingEnable(enable); } -void Context::setFog(bool enable) +void Context::setFogEnabled(bool enable) { if(drawing) { @@ -3248,7 +3248,7 @@ void Context::setFog(bool enable) device->setFogEnable(enable); } -void Context::setAlphaTest(bool enable) +void Context::setAlphaTestEnabled(bool enable) { if(drawing) { @@ -3281,7 +3281,7 @@ void Context::alphaFunc(GLenum func, GLclampf ref) device->setAlphaReference(gl::clamp01(ref)); } -void Context::setTexture2D(bool enable) +void Context::setTexture2DEnabled(bool enable) { if(drawing) { @@ -3306,12 +3306,12 @@ void Context::setShadeModel(GLenum mode) } } -void Context::setLight(int index, bool enable) +void Context::setLightEnabled(int index, bool enable) { device->setLightEnable(index, enable); } -void Context::setNormalizeNormals(bool enable) +void Context::setNormalizeNormalsEnabled(bool enable) { device->setNormalizeNormals(enable); } @@ -3425,7 +3425,7 @@ void APIENTRY glVertexAttribArray(GLuint index, GLint size, GLenum type, GLboole if(context) { context->setVertexAttribState(index, context->getArrayBuffer(), size, type, (normalized == GL_TRUE), stride, ptr); - context->setEnableVertexAttribArray(index, ptr != 0); + context->setVertexAttribArrayEnabled(index, ptr != 0); } } @@ -3614,18 +3614,18 @@ void Context::end() drawing = false; } -void Context::setColorLogicOpEnable(bool colorLogicOpEnabled) +void Context::setColorLogicOpEnabled(bool colorLogicOpEnabled) { - if(mState.colorLogicOp != colorLogicOpEnabled) + if(mState.colorLogicOpEnabled != colorLogicOpEnabled) { - mState.colorLogicOp = colorLogicOpEnabled; + mState.colorLogicOpEnabled = colorLogicOpEnabled; mColorLogicOperatorDirty = true; } } bool Context::isColorLogicOpEnabled() { - return mState.colorLogicOp; + return mState.colorLogicOpEnabled; } void Context::setLogicalOperation(GLenum logicalOperation) @@ -3633,7 +3633,7 @@ void Context::setLogicalOperation(GLenum logicalOperation) mState.logicalOperation = logicalOperation; } -void Context::setColorMaterial(bool enable) +void Context::setColorMaterialEnabled(bool enable) { device->setColorVertexEnable(enable); } diff --git a/src/OpenGL/libGL/Context.h b/src/OpenGL/libGL/Context.h index 704f7fde5..dd0844963 100644 --- a/src/OpenGL/libGL/Context.h +++ b/src/OpenGL/libGL/Context.h @@ -415,12 +415,12 @@ struct State GLclampf depthClearValue; int stencilClearValue; - bool cullFace; + bool cullFaceEnabled; GLenum cullMode; GLenum frontFace; - bool depthTest; + bool depthTestEnabled; GLenum depthFunc; - bool blend; + bool blendEnabled; GLenum sourceBlendRGB; GLenum destBlendRGB; GLenum sourceBlendAlpha; @@ -428,7 +428,7 @@ struct State GLenum blendEquationRGB; GLenum blendEquationAlpha; Color blendColor; - bool stencilTest; + bool stencilTestEnabled; GLenum stencilFunc; GLint stencilRef; GLuint stencilMask; @@ -443,16 +443,16 @@ struct State GLenum stencilBackPassDepthFail; GLenum stencilBackPassDepthPass; GLuint stencilBackWritemask; - bool polygonOffsetFill; + bool polygonOffsetFillEnabled; GLfloat polygonOffsetFactor; GLfloat polygonOffsetUnits; - bool sampleAlphaToCoverage; - bool sampleCoverage; + bool sampleAlphaToCoverageEnabled; + bool sampleCoverageEnabled; GLclampf sampleCoverageValue; bool sampleCoverageInvert; - bool scissorTest; - bool dither; - bool colorLogicOp; + bool scissorTestEnabled; + bool ditherEnabled; + bool colorLogicOpEnabled; GLenum logicalOperation; GLfloat lineWidth; @@ -510,23 +510,23 @@ public: void setClearDepth(float depth); void setClearStencil(int stencil); - void setCullFace(bool enabled); + void setCullFaceEnabled(bool enabled); bool isCullFaceEnabled() const; void setCullMode(GLenum mode); void setFrontFace(GLenum front); - void setDepthTest(bool enabled); + void setDepthTestEnabled(bool enabled); bool isDepthTestEnabled() const; void setDepthFunc(GLenum depthFunc); void setDepthRange(float zNear, float zFar); - void setBlend(bool enabled); + void setBlendEnabled(bool enabled); bool isBlendEnabled() const; void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha); void setBlendColor(float red, float green, float blue, float alpha); void setBlendEquation(GLenum rgbEquation, GLenum alphaEquation); - void setStencilTest(bool enabled); + void setStencilTestEnabled(bool enabled); bool isStencilTestEnabled() const; void setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask); void setStencilBackParams(GLenum stencilBackFunc, GLint stencilBackRef, GLuint stencilBackMask); @@ -535,17 +535,17 @@ public: void setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass); void setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBackPassDepthFail, GLenum stencilBackPassDepthPass); - void setPolygonOffsetFill(bool enabled); + void setPolygonOffsetFillEnabled(bool enabled); bool isPolygonOffsetFillEnabled() const; void setPolygonOffsetParams(GLfloat factor, GLfloat units); - void setSampleAlphaToCoverage(bool enabled); + void setSampleAlphaToCoverageEnabled(bool enabled); bool isSampleAlphaToCoverageEnabled() const; - void setSampleCoverage(bool enabled); + void setSampleCoverageEnabled(bool enabled); bool isSampleCoverageEnabled() const; void setSampleCoverageParams(GLclampf value, bool invert); - void setDither(bool enabled); + void setDitherEnabled(bool enabled); bool isDitherEnabled() const; void setLineWidth(GLfloat width); @@ -555,7 +555,7 @@ public: void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height); - void setScissorTest(bool enabled); + void setScissorTestEnabled(bool enabled); bool isScissorTestEnabled() const; void setScissorParams(GLint x, GLint y, GLsizei width, GLsizei height); @@ -572,7 +572,7 @@ public: GLuint getArrayBufferName() const; - void setEnableVertexAttribArray(unsigned int attribNum, bool enabled); + void setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled); const VertexAttribute &getVertexAttribState(unsigned int attribNum); void setVertexAttribState(unsigned int attribNum, Buffer *boundBuffer, GLint size, GLenum type, bool normalized, GLsizei stride, const void *pointer); @@ -687,14 +687,14 @@ public: void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); void ortho(double left, double right, double bottom, double top, double zNear, double zFar); // FIXME: GLdouble - void setLighting(bool enabled); - void setFog(bool enabled); - void setAlphaTest(bool enabled); + void setLightingEnabled(bool enabled); + void setFogEnabled(bool enabled); + void setAlphaTestEnabled(bool enabled); void alphaFunc(GLenum func, GLclampf ref); - void setTexture2D(bool enabled); + void setTexture2DEnabled(bool enabled); void setShadeModel(GLenum mode); - void setLight(int index, bool enable); - void setNormalizeNormals(bool enable); + void setLightEnabled(int index, bool enable); + void setNormalizeNormalsEnabled(bool enable); GLuint genLists(GLsizei range); void newList(GLuint list, GLenum mode); @@ -716,10 +716,10 @@ public: void position(GLfloat x, GLfloat y, GLfloat z, GLfloat w); void end(); - void setColorMaterial(bool enable); + void setColorMaterialEnabled(bool enable); void setColorMaterialMode(GLenum mode); - void setColorLogicOpEnable(bool colorLogicOpEnabled); + void setColorLogicOpEnabled(bool colorLogicOpEnabled); bool isColorLogicOpEnabled(); void setLogicalOperation(GLenum logicalOperation); diff --git a/src/OpenGL/libGL/libGL.cpp b/src/OpenGL/libGL/libGL.cpp index 6a7d33cbb..9b4516a6e 100644 --- a/src/OpenGL/libGL/libGL.cpp +++ b/src/OpenGL/libGL/libGL.cpp @@ -1591,30 +1591,30 @@ void APIENTRY glDisable(GLenum cap) switch(cap) { - case GL_CULL_FACE: context->setCullFace(false); break; - case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFill(false); break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverage(false); break; - case GL_SAMPLE_COVERAGE: context->setSampleCoverage(false); break; - case GL_SCISSOR_TEST: context->setScissorTest(false); break; - case GL_STENCIL_TEST: context->setStencilTest(false); break; - case GL_DEPTH_TEST: context->setDepthTest(false); break; - case GL_BLEND: context->setBlend(false); break; - case GL_DITHER: context->setDither(false); break; - case GL_LIGHTING: context->setLighting(false); break; - case GL_FOG: context->setFog(false); break; - case GL_ALPHA_TEST: context->setAlphaTest(false); break; - case GL_TEXTURE_2D: context->setTexture2D(false); break; - case GL_LIGHT0: context->setLight(0, false); break; - case GL_LIGHT1: context->setLight(1, false); break; - case GL_LIGHT2: context->setLight(2, false); break; - case GL_LIGHT3: context->setLight(3, false); break; - case GL_LIGHT4: context->setLight(4, false); break; - case GL_LIGHT5: context->setLight(5, false); break; - case GL_LIGHT6: context->setLight(6, false); break; - case GL_LIGHT7: context->setLight(7, false); break; - case GL_COLOR_MATERIAL: context->setColorMaterial(false); break; - case GL_RESCALE_NORMAL: context->setNormalizeNormals(false); break; - case GL_COLOR_LOGIC_OP: context->setColorLogicOpEnable(false); break; + case GL_CULL_FACE: context->setCullFaceEnabled(false); break; + case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFillEnabled(false); break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverageEnabled(false); break; + case GL_SAMPLE_COVERAGE: context->setSampleCoverageEnabled(false); break; + case GL_SCISSOR_TEST: context->setScissorTestEnabled(false); break; + case GL_STENCIL_TEST: context->setStencilTestEnabled(false); break; + case GL_DEPTH_TEST: context->setDepthTestEnabled(false); break; + case GL_BLEND: context->setBlendEnabled(false); break; + case GL_DITHER: context->setDitherEnabled(false); break; + case GL_LIGHTING: context->setLightingEnabled(false); break; + case GL_FOG: context->setFogEnabled(false); break; + case GL_ALPHA_TEST: context->setAlphaTestEnabled(false); break; + case GL_TEXTURE_2D: context->setTexture2DEnabled(false); break; + case GL_LIGHT0: context->setLightEnabled(0, false); break; + case GL_LIGHT1: context->setLightEnabled(1, false); break; + case GL_LIGHT2: context->setLightEnabled(2, false); break; + case GL_LIGHT3: context->setLightEnabled(3, false); break; + case GL_LIGHT4: context->setLightEnabled(4, false); break; + case GL_LIGHT5: context->setLightEnabled(5, false); break; + case GL_LIGHT6: context->setLightEnabled(6, false); break; + case GL_LIGHT7: context->setLightEnabled(7, false); break; + case GL_COLOR_MATERIAL: context->setColorMaterialEnabled(false); break; + case GL_RESCALE_NORMAL: context->setNormalizeNormalsEnabled(false); break; + case GL_COLOR_LOGIC_OP: context->setColorLogicOpEnabled(false); break; case GL_INDEX_LOGIC_OP: UNIMPLEMENTED(); default: return error(GL_INVALID_ENUM); @@ -1635,7 +1635,7 @@ void APIENTRY glDisableVertexAttribArray(GLuint index) if(context) { - context->setEnableVertexAttribArray(index, false); + context->setVertexAttribArrayEnabled(index, false); } } @@ -1740,30 +1740,30 @@ void APIENTRY glEnable(GLenum cap) switch(cap) { - case GL_CULL_FACE: context->setCullFace(true); break; - case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFill(true); break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverage(true); break; - case GL_SAMPLE_COVERAGE: context->setSampleCoverage(true); break; - case GL_SCISSOR_TEST: context->setScissorTest(true); break; - case GL_STENCIL_TEST: context->setStencilTest(true); break; - case GL_DEPTH_TEST: context->setDepthTest(true); break; - case GL_BLEND: context->setBlend(true); break; - case GL_DITHER: context->setDither(true); break; - case GL_TEXTURE_2D: context->setTexture2D(true); break; - case GL_ALPHA_TEST: context->setAlphaTest(true); break; - case GL_COLOR_MATERIAL: context->setColorMaterial(true); break; - case GL_FOG: context->setFog(true); break; - case GL_LIGHTING: context->setLighting(true); break; - case GL_LIGHT0: context->setLight(0, true); break; - case GL_LIGHT1: context->setLight(1, true); break; - case GL_LIGHT2: context->setLight(2, true); break; - case GL_LIGHT3: context->setLight(3, true); break; - case GL_LIGHT4: context->setLight(4, true); break; - case GL_LIGHT5: context->setLight(5, true); break; - case GL_LIGHT6: context->setLight(6, true); break; - case GL_LIGHT7: context->setLight(7, true); break; - case GL_RESCALE_NORMAL: context->setNormalizeNormals(true); break; - case GL_COLOR_LOGIC_OP: context->setColorLogicOpEnable(true); break; + case GL_CULL_FACE: context->setCullFaceEnabled(true); break; + case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFillEnabled(true); break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverageEnabled(true); break; + case GL_SAMPLE_COVERAGE: context->setSampleCoverageEnabled(true); break; + case GL_SCISSOR_TEST: context->setScissorTestEnabled(true); break; + case GL_STENCIL_TEST: context->setStencilTestEnabled(true); break; + case GL_DEPTH_TEST: context->setDepthTestEnabled(true); break; + case GL_BLEND: context->setBlendEnabled(true); break; + case GL_DITHER: context->setDitherEnabled(true); break; + case GL_TEXTURE_2D: context->setTexture2DEnabled(true); break; + case GL_ALPHA_TEST: context->setAlphaTestEnabled(true); break; + case GL_COLOR_MATERIAL: context->setColorMaterialEnabled(true); break; + case GL_FOG: context->setFogEnabled(true); break; + case GL_LIGHTING: context->setLightingEnabled(true); break; + case GL_LIGHT0: context->setLightEnabled(0, true); break; + case GL_LIGHT1: context->setLightEnabled(1, true); break; + case GL_LIGHT2: context->setLightEnabled(2, true); break; + case GL_LIGHT3: context->setLightEnabled(3, true); break; + case GL_LIGHT4: context->setLightEnabled(4, true); break; + case GL_LIGHT5: context->setLightEnabled(5, true); break; + case GL_LIGHT6: context->setLightEnabled(6, true); break; + case GL_LIGHT7: context->setLightEnabled(7, true); break; + case GL_RESCALE_NORMAL: context->setNormalizeNormalsEnabled(true); break; + case GL_COLOR_LOGIC_OP: context->setColorLogicOpEnabled(true); break; case GL_INDEX_LOGIC_OP: UNIMPLEMENTED(); default: return error(GL_INVALID_ENUM); @@ -1784,7 +1784,7 @@ void APIENTRY glEnableVertexAttribArray(GLuint index) if(context) { - context->setEnableVertexAttribArray(index, true); + context->setVertexAttribArrayEnabled(index, true); } } @@ -5935,10 +5935,10 @@ void APIENTRY glDisableClientState(GLenum array) switch(array) { - case GL_VERTEX_ARRAY: context->setEnableVertexAttribArray(sw::Position, false); break; - case GL_COLOR_ARRAY: context->setEnableVertexAttribArray(sw::Color0, false); break; - case GL_TEXTURE_COORD_ARRAY: context->setEnableVertexAttribArray(sw::TexCoord0 + (texture - GL_TEXTURE0), false); break; - case GL_NORMAL_ARRAY: context->setEnableVertexAttribArray(sw::Normal, false); break; + case GL_VERTEX_ARRAY: context->setVertexAttribArrayEnabled(sw::Position, false); break; + case GL_COLOR_ARRAY: context->setVertexAttribArrayEnabled(sw::Color0, false); break; + case GL_TEXTURE_COORD_ARRAY: context->setVertexAttribArrayEnabled(sw::TexCoord0 + (texture - GL_TEXTURE0), false); break; + case GL_NORMAL_ARRAY: context->setVertexAttribArrayEnabled(sw::Normal, false); break; default: UNIMPLEMENTED(); } } @@ -5981,10 +5981,10 @@ void APIENTRY glEnableClientState(GLenum array) switch(array) { - case GL_VERTEX_ARRAY: context->setEnableVertexAttribArray(sw::Position, true); break; - case GL_COLOR_ARRAY: context->setEnableVertexAttribArray(sw::Color0, true); break; - case GL_TEXTURE_COORD_ARRAY: context->setEnableVertexAttribArray(sw::TexCoord0 + (texture - GL_TEXTURE0), true); break; - case GL_NORMAL_ARRAY: context->setEnableVertexAttribArray(sw::Normal, true); break; + case GL_VERTEX_ARRAY: context->setVertexAttribArrayEnabled(sw::Position, true); break; + case GL_COLOR_ARRAY: context->setVertexAttribArrayEnabled(sw::Color0, true); break; + case GL_TEXTURE_COORD_ARRAY: context->setVertexAttribArrayEnabled(sw::TexCoord0 + (texture - GL_TEXTURE0), true); break; + case GL_NORMAL_ARRAY: context->setVertexAttribArrayEnabled(sw::Normal, true); break; default: UNIMPLEMENTED(); } } diff --git a/src/OpenGL/libGLES_CM/Context.cpp b/src/OpenGL/libGLES_CM/Context.cpp index 81db28919..5fc94d5c7 100644 --- a/src/OpenGL/libGLES_CM/Context.cpp +++ b/src/OpenGL/libGLES_CM/Context.cpp @@ -54,19 +54,19 @@ Context::Context(const egl::Config *config, const Context *shareContext) mState.depthClearValue = 1.0f; mState.stencilClearValue = 0; - mState.cullFace = false; + mState.cullFaceEnabled = false; mState.cullMode = GL_BACK; mState.frontFace = GL_CCW; - mState.depthTest = false; + mState.depthTestEnabled = false; mState.depthFunc = GL_LESS; - mState.blend = false; + mState.blendEnabled = false; mState.sourceBlendRGB = GL_ONE; mState.sourceBlendAlpha = GL_ONE; mState.destBlendRGB = GL_ZERO; mState.destBlendAlpha = GL_ZERO; mState.blendEquationRGB = GL_FUNC_ADD_OES; mState.blendEquationAlpha = GL_FUNC_ADD_OES; - mState.stencilTest = false; + mState.stencilTestEnabled = false; mState.stencilFunc = GL_ALWAYS; mState.stencilRef = 0; mState.stencilMask = -1; @@ -74,19 +74,19 @@ Context::Context(const egl::Config *config, const Context *shareContext) mState.stencilFail = GL_KEEP; mState.stencilPassDepthFail = GL_KEEP; mState.stencilPassDepthPass = GL_KEEP; - mState.polygonOffsetFill = false; + mState.polygonOffsetFillEnabled = false; mState.polygonOffsetFactor = 0.0f; mState.polygonOffsetUnits = 0.0f; - mState.sampleAlphaToCoverage = false; - mState.sampleCoverage = false; + mState.sampleAlphaToCoverageEnabled = false; + mState.sampleCoverageEnabled = false; mState.sampleCoverageValue = 1.0f; mState.sampleCoverageInvert = false; - mState.scissorTest = false; - mState.dither = true; + mState.scissorTestEnabled = false; + mState.ditherEnabled = true; mState.shadeModel = GL_SMOOTH; mState.generateMipmapHint = GL_DONT_CARE; mState.perspectiveCorrectionHint = GL_DONT_CARE; - mState.colorLogicOp = false; + mState.colorLogicOpEnabled = false; mState.logicalOperation = GL_COPY; mState.lineWidth = 1.0f; @@ -166,11 +166,11 @@ Context::Context(const egl::Config *config, const Context *shareContext) mMatrixStackOverflow = false; mMatrixStackUnderflow = false; - lighting = false; + lightingEnabled = false; for(int i = 0; i < MAX_LIGHTS; i++) { - light[i].enable = false; + light[i].enabled = false; light[i].ambient = {0.0f, 0.0f, 0.0f, 1.0f}; light[i].diffuse = {0.0f, 0.0f, 0.0f, 1.0f}; light[i].specular = {0.0f, 0.0f, 0.0f, 1.0f}; @@ -211,7 +211,7 @@ Context::Context(const egl::Config *config, const Context *shareContext) clipFlags = 0; - alphaTest = false; + alphaTestEnabled = false; alphaTestFunc = GL_ALWAYS; alphaTestRef = 0; @@ -330,14 +330,14 @@ void Context::setClearStencil(int stencil) mState.stencilClearValue = stencil; } -void Context::setCullFace(bool enabled) +void Context::setCullFaceEnabled(bool enabled) { - mState.cullFace = enabled; + mState.cullFaceEnabled = enabled; } bool Context::isCullFaceEnabled() const { - return mState.cullFace; + return mState.cullFaceEnabled; } void Context::setCullMode(GLenum mode) @@ -354,18 +354,18 @@ void Context::setFrontFace(GLenum front) } } -void Context::setDepthTest(bool enabled) +void Context::setDepthTestEnabled(bool enabled) { - if(mState.depthTest != enabled) + if(mState.depthTestEnabled != enabled) { - mState.depthTest = enabled; + mState.depthTestEnabled = enabled; mDepthStateDirty = true; } } bool Context::isDepthTestEnabled() const { - return mState.depthTest; + return mState.depthTestEnabled; } void Context::setDepthFunc(GLenum depthFunc) @@ -383,14 +383,14 @@ void Context::setDepthRange(float zNear, float zFar) mState.zFar = zFar; } -void Context::setAlphaTest(bool enabled) +void Context::setAlphaTestEnabled(bool enabled) { - alphaTest = enabled; + alphaTestEnabled = enabled; } bool Context::isAlphaTestEnabled() const { - return alphaTest; + return alphaTestEnabled; } void Context::setAlphaFunc(GLenum alphaFunc, GLclampf reference) @@ -399,18 +399,18 @@ void Context::setAlphaFunc(GLenum alphaFunc, GLclampf reference) alphaTestRef = reference; } -void Context::setBlend(bool enabled) +void Context::setBlendEnabled(bool enabled) { - if(mState.blend != enabled) + if(mState.blendEnabled != enabled) { - mState.blend = enabled; + mState.blendEnabled = enabled; mBlendStateDirty = true; } } bool Context::isBlendEnabled() const { - return mState.blend; + return mState.blendEnabled; } void Context::setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha) @@ -439,18 +439,18 @@ void Context::setBlendEquation(GLenum rgbEquation, GLenum alphaEquation) } } -void Context::setStencilTest(bool enabled) +void Context::setStencilTestEnabled(bool enabled) { - if(mState.stencilTest != enabled) + if(mState.stencilTestEnabled != enabled) { - mState.stencilTest = enabled; + mState.stencilTestEnabled = enabled; mStencilStateDirty = true; } } bool Context::isStencilTestEnabled() const { - return mState.stencilTest; + return mState.stencilTestEnabled; } void Context::setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask) @@ -488,18 +488,18 @@ void Context::setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFa } } -void Context::setPolygonOffsetFill(bool enabled) +void Context::setPolygonOffsetFillEnabled(bool enabled) { - if(mState.polygonOffsetFill != enabled) + if(mState.polygonOffsetFillEnabled != enabled) { - mState.polygonOffsetFill = enabled; + mState.polygonOffsetFillEnabled = enabled; mPolygonOffsetStateDirty = true; } } bool Context::isPolygonOffsetFillEnabled() const { - return mState.polygonOffsetFill; + return mState.polygonOffsetFillEnabled; } void Context::setPolygonOffsetParams(GLfloat factor, GLfloat units) @@ -513,32 +513,32 @@ void Context::setPolygonOffsetParams(GLfloat factor, GLfloat units) } } -void Context::setSampleAlphaToCoverage(bool enabled) +void Context::setSampleAlphaToCoverageEnabled(bool enabled) { - if(mState.sampleAlphaToCoverage != enabled) + if(mState.sampleAlphaToCoverageEnabled != enabled) { - mState.sampleAlphaToCoverage = enabled; + mState.sampleAlphaToCoverageEnabled = enabled; mSampleStateDirty = true; } } bool Context::isSampleAlphaToCoverageEnabled() const { - return mState.sampleAlphaToCoverage; + return mState.sampleAlphaToCoverageEnabled; } -void Context::setSampleCoverage(bool enabled) +void Context::setSampleCoverageEnabled(bool enabled) { - if(mState.sampleCoverage != enabled) + if(mState.sampleCoverageEnabled != enabled) { - mState.sampleCoverage = enabled; + mState.sampleCoverageEnabled = enabled; mSampleStateDirty = true; } } bool Context::isSampleCoverageEnabled() const { - return mState.sampleCoverage; + return mState.sampleCoverageEnabled; } void Context::setSampleCoverageParams(GLclampf value, bool invert) @@ -552,14 +552,14 @@ void Context::setSampleCoverageParams(GLclampf value, bool invert) } } -void Context::setScissorTest(bool enabled) +void Context::setScissorTestEnabled(bool enabled) { - mState.scissorTest = enabled; + mState.scissorTestEnabled = enabled; } bool Context::isScissorTestEnabled() const { - return mState.scissorTest; + return mState.scissorTestEnabled; } void Context::setShadeModel(GLenum mode) @@ -567,28 +567,28 @@ void Context::setShadeModel(GLenum mode) mState.shadeModel = mode; } -void Context::setDither(bool enabled) +void Context::setDitherEnabled(bool enabled) { - if(mState.dither != enabled) + if(mState.ditherEnabled != enabled) { - mState.dither = enabled; + mState.ditherEnabled = enabled; mDitherStateDirty = true; } } bool Context::isDitherEnabled() const { - return mState.dither; + return mState.ditherEnabled; } -void Context::setLighting(bool enable) +void Context::setLightingEnabled(bool enable) { - lighting = enable; + lightingEnabled = enable; } -void Context::setLight(int index, bool enable) +void Context::setLightEnabled(int index, bool enable) { - light[index].enable = enable; + light[index].enabled = enable; } void Context::setLightAmbient(int index, float r, float g, float b, float a) @@ -682,7 +682,7 @@ void Context::setMaterialShininess(float shininess) materialShininess = shininess; } -void Context::setFog(bool enable) +void Context::setFogEnabled(bool enable) { device->setFogEnable(enable); } @@ -809,7 +809,7 @@ GLuint Context::getArrayBufferName() const return mState.arrayBuffer.name(); } -void Context::setEnableVertexAttribArray(unsigned int attribNum, bool enabled) +void Context::setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled) { mState.vertexAttribute[attribNum].mArrayEnabled = enabled; } @@ -1057,26 +1057,26 @@ Texture *Context::getSamplerTexture(unsigned int sampler, TextureType type) bool Context::getBooleanv(GLenum pname, GLboolean *params) { - switch (pname) + switch(pname) { - case GL_SAMPLE_COVERAGE_INVERT: *params = mState.sampleCoverageInvert; break; - case GL_DEPTH_WRITEMASK: *params = mState.depthMask; break; - case GL_COLOR_WRITEMASK: + case GL_SAMPLE_COVERAGE_INVERT: *params = mState.sampleCoverageInvert; break; + case GL_DEPTH_WRITEMASK: *params = mState.depthMask; break; + case GL_COLOR_WRITEMASK: params[0] = mState.colorMaskRed; params[1] = mState.colorMaskGreen; params[2] = mState.colorMaskBlue; params[3] = mState.colorMaskAlpha; break; - case GL_CULL_FACE: *params = mState.cullFace; break; - case GL_POLYGON_OFFSET_FILL: *params = mState.polygonOffsetFill; break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: *params = mState.sampleAlphaToCoverage; break; - case GL_SAMPLE_COVERAGE: *params = mState.sampleCoverage; break; - case GL_SCISSOR_TEST: *params = mState.scissorTest; break; - case GL_STENCIL_TEST: *params = mState.stencilTest; break; - case GL_DEPTH_TEST: *params = mState.depthTest; break; - case GL_BLEND: *params = mState.blend; break; - case GL_DITHER: *params = mState.dither; break; - default: + case GL_CULL_FACE: *params = mState.cullFaceEnabled; break; + case GL_POLYGON_OFFSET_FILL: *params = mState.polygonOffsetFillEnabled; break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: *params = mState.sampleAlphaToCoverageEnabled; break; + case GL_SAMPLE_COVERAGE: *params = mState.sampleCoverageEnabled; break; + case GL_SCISSOR_TEST: *params = mState.scissorTestEnabled; break; + case GL_STENCIL_TEST: *params = mState.stencilTestEnabled; break; + case GL_DEPTH_TEST: *params = mState.depthTestEnabled; break; + case GL_BLEND: *params = mState.blendEnabled; break; + case GL_DITHER: *params = mState.ditherEnabled; break; + default: return false; } @@ -1601,7 +1601,7 @@ bool Context::applyRenderTarget() device->setViewport(viewport); - if(mState.scissorTest) + if(mState.scissorTestEnabled) { sw::Rect scissor = {mState.scissorX, mState.scissorY, mState.scissorX + mState.scissorWidth, mState.scissorY + mState.scissorHeight}; scissor.clip(0, 0, width, height); @@ -1622,7 +1622,7 @@ void Context::applyState(GLenum drawMode) { Framebuffer *framebuffer = getFramebuffer(); - if(mState.cullFace) + if(mState.cullFaceEnabled) { device->setCullMode(es2sw::ConvertCullMode(mState.cullMode, mState.frontFace)); } @@ -1633,7 +1633,7 @@ void Context::applyState(GLenum drawMode) if(mDepthStateDirty) { - if(mState.depthTest) + if(mState.depthTestEnabled) { device->setDepthBufferEnable(true); device->setDepthCompare(es2sw::ConvertDepthComparison(mState.depthFunc)); @@ -1648,7 +1648,7 @@ void Context::applyState(GLenum drawMode) if(mBlendStateDirty) { - if(mState.blend) + if(mState.blendEnabled) { device->setAlphaBlendEnable(true); device->setSeparateAlphaBlendEnable(true); @@ -1671,7 +1671,7 @@ void Context::applyState(GLenum drawMode) if(mStencilStateDirty || mFrontFaceDirty) { - if(mState.stencilTest && framebuffer->hasStencil()) + if(mState.stencilTestEnabled && framebuffer->hasStencil()) { device->setStencilEnable(true); device->setTwoSidedStencil(true); @@ -1719,7 +1719,7 @@ void Context::applyState(GLenum drawMode) if(mPolygonOffsetStateDirty) { - if(mState.polygonOffsetFill) + if(mState.polygonOffsetFillEnabled) { Renderbuffer *depthbuffer = framebuffer->getDepthbuffer(); if(depthbuffer) @@ -1740,7 +1740,7 @@ void Context::applyState(GLenum drawMode) if(mSampleStateDirty) { - if(mState.sampleAlphaToCoverage) + if(mState.sampleAlphaToCoverageEnabled) { device->setTransparencyAntialiasing(sw::TRANSPARENCY_ALPHA_TO_COVERAGE); } @@ -1749,7 +1749,7 @@ void Context::applyState(GLenum drawMode) device->setTransparencyAntialiasing(sw::TRANSPARENCY_NONE); } - if(mState.sampleCoverage) + if(mState.sampleCoverageEnabled) { unsigned int mask = 0; if(mState.sampleCoverageValue != 0) @@ -1800,12 +1800,12 @@ void Context::applyState(GLenum drawMode) case GL_FLAT: device->setShadingMode(sw::SHADING_FLAT); break; } - device->setLightingEnable(lighting); + device->setLightingEnable(lightingEnabled); device->setGlobalAmbient(sw::Color(globalAmbient.red, globalAmbient.green, globalAmbient.blue, globalAmbient.alpha)); for(int i = 0; i < MAX_LIGHTS; i++) { - device->setLightEnable(i, light[i].enable); + device->setLightEnable(i, light[i].enabled); device->setLightAmbient(i, sw::Color(light[i].ambient.red, light[i].ambient.green, light[i].ambient.blue, light[i].ambient.alpha)); device->setLightDiffuse(i, sw::Color(light[i].diffuse.red, light[i].diffuse.green, light[i].diffuse.blue, light[i].diffuse.alpha)); device->setLightSpecular(i, sw::Color(light[i].specular.red, light[i].specular.green, light[i].specular.blue, light[i].specular.alpha)); @@ -1848,7 +1848,7 @@ void Context::applyState(GLenum drawMode) device->setTexGen(0, sw::TEXGEN_NONE); device->setTexGen(1, sw::TEXGEN_NONE); - device->setAlphaTestEnable(alphaTest); + device->setAlphaTestEnable(alphaTestEnabled); device->setAlphaCompare(es2sw::ConvertAlphaComparison(alphaTestFunc)); device->setAlphaReference(alphaTestRef * 0xFF); } @@ -2893,7 +2893,7 @@ void Context::detachRenderbuffer(GLuint renderbuffer) bool Context::cullSkipsDraw(GLenum drawMode) { - return mState.cullFace && mState.cullMode == GL_FRONT_AND_BACK && isTriangleMode(drawMode); + return mState.cullFaceEnabled && mState.cullMode == GL_FRONT_AND_BACK && isTriangleMode(drawMode); } bool Context::isTriangleMode(GLenum drawMode) @@ -3109,7 +3109,7 @@ void Context::setClipPlane(int index, const float plane[4]) device->setClipPlane(index, &clipPlane.A); } -void Context::setClipPlaneEnable(int index, bool enable) +void Context::setClipPlaneEnabled(int index, bool enable) { clipFlags = clipFlags & ~((int)!enable << index) | ((int)enable << index); device->setClipFlags(clipFlags); diff --git a/src/OpenGL/libGLES_CM/Context.h b/src/OpenGL/libGLES_CM/Context.h index 064bc7af5..b1073a468 100644 --- a/src/OpenGL/libGLES_CM/Context.h +++ b/src/OpenGL/libGLES_CM/Context.h @@ -120,7 +120,7 @@ struct Attenuation struct Light { - bool enable; + bool enabled; Color ambient; Color diffuse; Color specular; @@ -207,19 +207,19 @@ struct State GLclampf depthClearValue; int stencilClearValue; - bool cullFace; + bool cullFaceEnabled; GLenum cullMode; GLenum frontFace; - bool depthTest; + bool depthTestEnabled; GLenum depthFunc; - bool blend; + bool blendEnabled; GLenum sourceBlendRGB; GLenum destBlendRGB; GLenum sourceBlendAlpha; GLenum destBlendAlpha; GLenum blendEquationRGB; GLenum blendEquationAlpha; - bool stencilTest; + bool stencilTestEnabled; GLenum stencilFunc; GLint stencilRef; GLuint stencilMask; @@ -227,17 +227,17 @@ struct State GLenum stencilPassDepthFail; GLenum stencilPassDepthPass; GLuint stencilWritemask; - bool polygonOffsetFill; + bool polygonOffsetFillEnabled; GLfloat polygonOffsetFactor; GLfloat polygonOffsetUnits; - bool sampleAlphaToCoverage; - bool sampleCoverage; + bool sampleAlphaToCoverageEnabled; + bool sampleCoverageEnabled; GLclampf sampleCoverageValue; bool sampleCoverageInvert; - bool scissorTest; - bool dither; + bool scissorTestEnabled; + bool ditherEnabled; GLenum shadeModel; - bool colorLogicOp; + bool colorLogicOpEnabled; GLenum logicalOperation; GLfloat lineWidth; @@ -293,46 +293,46 @@ public: void setClearDepth(float depth); void setClearStencil(int stencil); - void setCullFace(bool enabled); + void setCullFaceEnabled(bool enabled); bool isCullFaceEnabled() const; void setCullMode(GLenum mode); void setFrontFace(GLenum front); - void setDepthTest(bool enabled); + void setDepthTestEnabled(bool enabled); bool isDepthTestEnabled() const; void setDepthFunc(GLenum depthFunc); void setDepthRange(float zNear, float zFar); - void setAlphaTest(bool enabled); + void setAlphaTestEnabled(bool enabled); bool isAlphaTestEnabled() const; void setAlphaFunc(GLenum alphaFunc, GLclampf reference); - void setBlend(bool enabled); + void setBlendEnabled(bool enabled); bool isBlendEnabled() const; void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha); void setBlendEquation(GLenum rgbEquation, GLenum alphaEquation); - void setStencilTest(bool enabled); + void setStencilTestEnabled(bool enabled); bool isStencilTestEnabled() const; void setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask); void setStencilWritemask(GLuint stencilWritemask); void setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass); - void setPolygonOffsetFill(bool enabled); + void setPolygonOffsetFillEnabled(bool enabled); bool isPolygonOffsetFillEnabled() const; void setPolygonOffsetParams(GLfloat factor, GLfloat units); - void setSampleAlphaToCoverage(bool enabled); + void setSampleAlphaToCoverageEnabled(bool enabled); bool isSampleAlphaToCoverageEnabled() const; - void setSampleCoverage(bool enabled); + void setSampleCoverageEnabled(bool enabled); bool isSampleCoverageEnabled() const; void setSampleCoverageParams(GLclampf value, bool invert); void setShadeModel(GLenum mode); - void setDither(bool enabled); + void setDitherEnabled(bool enabled); bool isDitherEnabled() const; - void setLighting(bool enabled); - void setLight(int index, bool enable); + void setLightingEnabled(bool enabled); + void setLightEnabled(int index, bool enable); void setLightAmbient(int index, float r, float g, float b, float a); void setLightDiffuse(int index, float r, float g, float b, float a); void setLightSpecular(int index, float r, float g, float b, float a); @@ -349,7 +349,7 @@ public: void setMaterialEmission(float red, float green, float blue, float alpha); void setMaterialShininess(float shininess); - void setFog(bool enabled); + void setFogEnabled(bool enabled); void setFogMode(GLenum mode); void setFogDensity(float fogDensity); void setFogStart(float fogStart); @@ -386,7 +386,7 @@ public: void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height); - void setScissorTest(bool enabled); + void setScissorTestEnabled(bool enabled); bool isScissorTestEnabled() const; void setScissorParams(GLint x, GLint y, GLsizei width, GLsizei height); @@ -400,7 +400,7 @@ public: GLuint getArrayBufferName() const; - void setEnableVertexAttribArray(unsigned int attribNum, bool enabled); + void setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled); const VertexAttribute &getVertexAttribState(unsigned int attribNum); void setVertexAttribState(unsigned int attribNum, Buffer *boundBuffer, GLint size, GLenum type, bool normalized, GLsizei stride, const void *pointer); @@ -501,7 +501,7 @@ public: void ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); void setClipPlane(int index, const float plane[4]); - void setClipPlaneEnable(int index, bool enable); + void setClipPlaneEnabled(int index, bool enable); bool isClipPlaneEnabled(int index) const; private: @@ -534,7 +534,7 @@ private: VertexDataManager *mVertexDataManager; IndexDataManager *mIndexDataManager; - bool lighting; + bool lightingEnabled; Light light[MAX_LIGHTS]; Color globalAmbient; Color materialAmbient; @@ -578,7 +578,7 @@ private: int clipFlags; - bool alphaTest; + bool alphaTestEnabled; GLenum alphaTestFunc; float alphaTestRef; diff --git a/src/OpenGL/libGLES_CM/libGLES_CM.cpp b/src/OpenGL/libGLES_CM/libGLES_CM.cpp index 39f894a69..0119030f7 100644 --- a/src/OpenGL/libGLES_CM/libGLES_CM.cpp +++ b/src/OpenGL/libGLES_CM/libGLES_CM.cpp @@ -1189,28 +1189,28 @@ void Disable(GLenum cap) { switch(cap) { - case GL_CULL_FACE: context->setCullFace(false); break; - case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFill(false); break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverage(false); break; - case GL_SAMPLE_COVERAGE: context->setSampleCoverage(false); break; - case GL_SCISSOR_TEST: context->setScissorTest(false); break; - case GL_STENCIL_TEST: context->setStencilTest(false); break; - case GL_DEPTH_TEST: context->setDepthTest(false); break; - case GL_BLEND: context->setBlend(false); break; - case GL_DITHER: context->setDither(false); break; - case GL_LIGHTING: context->setLighting(false); break; - case GL_LIGHT0: context->setLight(0, false); break; - case GL_LIGHT1: context->setLight(1, false); break; - case GL_LIGHT2: context->setLight(2, false); break; - case GL_LIGHT3: context->setLight(3, false); break; - case GL_LIGHT4: context->setLight(4, false); break; - case GL_LIGHT5: context->setLight(5, false); break; - case GL_LIGHT6: context->setLight(6, false); break; - case GL_LIGHT7: context->setLight(7, false); break; - case GL_FOG: context->setFog(false); break; - case GL_TEXTURE_2D: context->setTexture2Denabled(false); break; - case GL_TEXTURE_EXTERNAL_OES: context->setTextureExternalEnabled(false); break; - case GL_ALPHA_TEST: context->setAlphaTest(false); break; + case GL_CULL_FACE: context->setCullFaceEnabled(false); break; + case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFillEnabled(false); break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverageEnabled(false); break; + case GL_SAMPLE_COVERAGE: context->setSampleCoverageEnabled(false); break; + case GL_SCISSOR_TEST: context->setScissorTestEnabled(false); break; + case GL_STENCIL_TEST: context->setStencilTestEnabled(false); break; + case GL_DEPTH_TEST: context->setDepthTestEnabled(false); break; + case GL_BLEND: context->setBlendEnabled(false); break; + case GL_DITHER: context->setDitherEnabled(false); break; + case GL_LIGHTING: context->setLightingEnabled(false); break; + case GL_LIGHT0: context->setLightEnabled(0, false); break; + case GL_LIGHT1: context->setLightEnabled(1, false); break; + case GL_LIGHT2: context->setLightEnabled(2, false); break; + case GL_LIGHT3: context->setLightEnabled(3, false); break; + case GL_LIGHT4: context->setLightEnabled(4, false); break; + case GL_LIGHT5: context->setLightEnabled(5, false); break; + case GL_LIGHT6: context->setLightEnabled(6, false); break; + case GL_LIGHT7: context->setLightEnabled(7, false); break; + case GL_FOG: context->setFogEnabled(false); break; + case GL_TEXTURE_2D: context->setTexture2Denabled(false); break; + case GL_TEXTURE_EXTERNAL_OES: context->setTextureExternalEnabled(false); break; + case GL_ALPHA_TEST: context->setAlphaTestEnabled(false); break; case GL_COLOR_LOGIC_OP: UNIMPLEMENTED(); break; case GL_POINT_SMOOTH: UNIMPLEMENTED(); break; case GL_LINE_SMOOTH: UNIMPLEMENTED(); break; @@ -1223,12 +1223,12 @@ void Disable(GLenum cap) case GL_TEXTURE_COORD_ARRAY: UNIMPLEMENTED(); break; case GL_MULTISAMPLE: UNIMPLEMENTED(); break; case GL_SAMPLE_ALPHA_TO_ONE: UNIMPLEMENTED(); break; - case GL_CLIP_PLANE0: context->setClipPlaneEnable(0, false); break; - case GL_CLIP_PLANE1: context->setClipPlaneEnable(1, false); break; - case GL_CLIP_PLANE2: context->setClipPlaneEnable(2, false); break; - case GL_CLIP_PLANE3: context->setClipPlaneEnable(3, false); break; - case GL_CLIP_PLANE4: context->setClipPlaneEnable(4, false); break; - case GL_CLIP_PLANE5: context->setClipPlaneEnable(5, false); break; + case GL_CLIP_PLANE0: context->setClipPlaneEnabled(0, false); break; + case GL_CLIP_PLANE1: context->setClipPlaneEnabled(1, false); break; + case GL_CLIP_PLANE2: context->setClipPlaneEnabled(2, false); break; + case GL_CLIP_PLANE3: context->setClipPlaneEnabled(3, false); break; + case GL_CLIP_PLANE4: context->setClipPlaneEnabled(4, false); break; + case GL_CLIP_PLANE5: context->setClipPlaneEnabled(5, false); break; default: return error(GL_INVALID_ENUM); } @@ -1247,10 +1247,10 @@ void DisableClientState(GLenum array) switch (array) { - case GL_VERTEX_ARRAY: context->setEnableVertexAttribArray(sw::Position, false); break; - case GL_COLOR_ARRAY: context->setEnableVertexAttribArray(sw::Color0, false); break; - case GL_TEXTURE_COORD_ARRAY: context->setEnableVertexAttribArray(sw::TexCoord0 + (texture - GL_TEXTURE0), false); break; - case GL_NORMAL_ARRAY: context->setEnableVertexAttribArray(sw::Normal, false); break; + case GL_VERTEX_ARRAY: context->setVertexAttribArrayEnabled(sw::Position, false); break; + case GL_COLOR_ARRAY: context->setVertexAttribArrayEnabled(sw::Color0, false); break; + case GL_TEXTURE_COORD_ARRAY: context->setVertexAttribArrayEnabled(sw::TexCoord0 + (texture - GL_TEXTURE0), false); break; + case GL_NORMAL_ARRAY: context->setVertexAttribArrayEnabled(sw::Normal, false); break; default: UNIMPLEMENTED(); } } @@ -1311,28 +1311,28 @@ void Enable(GLenum cap) { switch(cap) { - case GL_CULL_FACE: context->setCullFace(true); break; - case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFill(true); break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverage(true); break; - case GL_SAMPLE_COVERAGE: context->setSampleCoverage(true); break; - case GL_SCISSOR_TEST: context->setScissorTest(true); break; - case GL_STENCIL_TEST: context->setStencilTest(true); break; - case GL_DEPTH_TEST: context->setDepthTest(true); break; - case GL_BLEND: context->setBlend(true); break; - case GL_DITHER: context->setDither(true); break; - case GL_LIGHTING: context->setLighting(true); break; - case GL_LIGHT0: context->setLight(0, true); break; - case GL_LIGHT1: context->setLight(1, true); break; - case GL_LIGHT2: context->setLight(2, true); break; - case GL_LIGHT3: context->setLight(3, true); break; - case GL_LIGHT4: context->setLight(4, true); break; - case GL_LIGHT5: context->setLight(5, true); break; - case GL_LIGHT6: context->setLight(6, true); break; - case GL_LIGHT7: context->setLight(7, true); break; - case GL_FOG: context->setFog(true); break; - case GL_TEXTURE_2D: context->setTexture2Denabled(true); break; - case GL_TEXTURE_EXTERNAL_OES: context->setTextureExternalEnabled(true); break; - case GL_ALPHA_TEST: context->setAlphaTest(true); break; + case GL_CULL_FACE: context->setCullFaceEnabled(true); break; + case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFillEnabled(true); break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverageEnabled(true); break; + case GL_SAMPLE_COVERAGE: context->setSampleCoverageEnabled(true); break; + case GL_SCISSOR_TEST: context->setScissorTestEnabled(true); break; + case GL_STENCIL_TEST: context->setStencilTestEnabled(true); break; + case GL_DEPTH_TEST: context->setDepthTestEnabled(true); break; + case GL_BLEND: context->setBlendEnabled(true); break; + case GL_DITHER: context->setDitherEnabled(true); break; + case GL_LIGHTING: context->setLightingEnabled(true); break; + case GL_LIGHT0: context->setLightEnabled(0, true); break; + case GL_LIGHT1: context->setLightEnabled(1, true); break; + case GL_LIGHT2: context->setLightEnabled(2, true); break; + case GL_LIGHT3: context->setLightEnabled(3, true); break; + case GL_LIGHT4: context->setLightEnabled(4, true); break; + case GL_LIGHT5: context->setLightEnabled(5, true); break; + case GL_LIGHT6: context->setLightEnabled(6, true); break; + case GL_LIGHT7: context->setLightEnabled(7, true); break; + case GL_FOG: context->setFogEnabled(true); break; + case GL_TEXTURE_2D: context->setTexture2Denabled(true); break; + case GL_TEXTURE_EXTERNAL_OES: context->setTextureExternalEnabled(true); break; + case GL_ALPHA_TEST: context->setAlphaTestEnabled(true); break; case GL_COLOR_LOGIC_OP: UNIMPLEMENTED(); break; case GL_POINT_SMOOTH: UNIMPLEMENTED(); break; case GL_LINE_SMOOTH: UNIMPLEMENTED(); break; @@ -1345,12 +1345,12 @@ void Enable(GLenum cap) case GL_TEXTURE_COORD_ARRAY: UNIMPLEMENTED(); break; case GL_MULTISAMPLE: UNIMPLEMENTED(); break; case GL_SAMPLE_ALPHA_TO_ONE: UNIMPLEMENTED(); break; - case GL_CLIP_PLANE0: context->setClipPlaneEnable(0, true); break; - case GL_CLIP_PLANE1: context->setClipPlaneEnable(1, true); break; - case GL_CLIP_PLANE2: context->setClipPlaneEnable(2, true); break; - case GL_CLIP_PLANE3: context->setClipPlaneEnable(3, true); break; - case GL_CLIP_PLANE4: context->setClipPlaneEnable(4, true); break; - case GL_CLIP_PLANE5: context->setClipPlaneEnable(5, true); break; + case GL_CLIP_PLANE0: context->setClipPlaneEnabled(0, true); break; + case GL_CLIP_PLANE1: context->setClipPlaneEnabled(1, true); break; + case GL_CLIP_PLANE2: context->setClipPlaneEnabled(2, true); break; + case GL_CLIP_PLANE3: context->setClipPlaneEnabled(3, true); break; + case GL_CLIP_PLANE4: context->setClipPlaneEnabled(4, true); break; + case GL_CLIP_PLANE5: context->setClipPlaneEnabled(5, true); break; default: return error(GL_INVALID_ENUM); } @@ -1369,10 +1369,10 @@ void EnableClientState(GLenum array) switch(array) { - case GL_VERTEX_ARRAY: context->setEnableVertexAttribArray(sw::Position, true); break; - case GL_COLOR_ARRAY: context->setEnableVertexAttribArray(sw::Color0, true); break; - case GL_TEXTURE_COORD_ARRAY: context->setEnableVertexAttribArray(sw::TexCoord0 + (texture - GL_TEXTURE0), true); break; - case GL_NORMAL_ARRAY: context->setEnableVertexAttribArray(sw::Normal, true); break; + case GL_VERTEX_ARRAY: context->setVertexAttribArrayEnabled(sw::Position, true); break; + case GL_COLOR_ARRAY: context->setVertexAttribArrayEnabled(sw::Color0, true); break; + case GL_TEXTURE_COORD_ARRAY: context->setVertexAttribArrayEnabled(sw::TexCoord0 + (texture - GL_TEXTURE0), true); break; + case GL_NORMAL_ARRAY: context->setVertexAttribArrayEnabled(sw::Normal, true); break; default: UNIMPLEMENTED(); } } diff --git a/src/OpenGL/libGLESv2/Context.cpp b/src/OpenGL/libGLESv2/Context.cpp index ae733d054..079c157cf 100644 --- a/src/OpenGL/libGLESv2/Context.cpp +++ b/src/OpenGL/libGLESv2/Context.cpp @@ -55,12 +55,12 @@ Context::Context(const egl::Config *config, const Context *shareContext, EGLint mState.depthClearValue = 1.0f; mState.stencilClearValue = 0; - mState.cullFace = false; + mState.cullFaceEnabled = false; mState.cullMode = GL_BACK; mState.frontFace = GL_CCW; - mState.depthTest = false; + mState.depthTestEnabled = false; mState.depthFunc = GL_LESS; - mState.blend = false; + mState.blendEnabled = false; mState.sourceBlendRGB = GL_ONE; mState.sourceBlendAlpha = GL_ONE; mState.destBlendRGB = GL_ZERO; @@ -71,7 +71,7 @@ Context::Context(const egl::Config *config, const Context *shareContext, EGLint mState.blendColor.green = 0; mState.blendColor.blue = 0; mState.blendColor.alpha = 0; - mState.stencilTest = false; + mState.stencilTestEnabled = false; mState.stencilFunc = GL_ALWAYS; mState.stencilRef = 0; mState.stencilMask = -1; @@ -86,17 +86,17 @@ Context::Context(const egl::Config *config, const Context *shareContext, EGLint mState.stencilBackFail = GL_KEEP; mState.stencilBackPassDepthFail = GL_KEEP; mState.stencilBackPassDepthPass = GL_KEEP; - mState.polygonOffsetFill = false; + mState.polygonOffsetFillEnabled = false; mState.polygonOffsetFactor = 0.0f; mState.polygonOffsetUnits = 0.0f; - mState.sampleAlphaToCoverage = false; - mState.sampleCoverage = false; + mState.sampleAlphaToCoverageEnabled = false; + mState.sampleCoverageEnabled = false; mState.sampleCoverageValue = 1.0f; mState.sampleCoverageInvert = false; - mState.scissorTest = false; - mState.dither = true; - mState.primitiveRestartFixedIndex = false; - mState.rasterizerDiscard = false; + mState.scissorTestEnabled = false; + mState.ditherEnabled = true; + mState.primitiveRestartFixedIndexEnabled = false; + mState.rasterizerDiscardEnabled = false; mState.generateMipmapHint = GL_DONT_CARE; mState.fragmentShaderDerivativeHint = GL_DONT_CARE; @@ -349,14 +349,14 @@ void Context::setClearStencil(int stencil) mState.stencilClearValue = stencil; } -void Context::setCullFace(bool enabled) +void Context::setCullFaceEnabled(bool enabled) { - mState.cullFace = enabled; + mState.cullFaceEnabled = enabled; } bool Context::isCullFaceEnabled() const { - return mState.cullFace; + return mState.cullFaceEnabled; } void Context::setCullMode(GLenum mode) @@ -373,18 +373,18 @@ void Context::setFrontFace(GLenum front) } } -void Context::setDepthTest(bool enabled) +void Context::setDepthTestEnabled(bool enabled) { - if(mState.depthTest != enabled) + if(mState.depthTestEnabled != enabled) { - mState.depthTest = enabled; + mState.depthTestEnabled = enabled; mDepthStateDirty = true; } } bool Context::isDepthTestEnabled() const { - return mState.depthTest; + return mState.depthTestEnabled; } void Context::setDepthFunc(GLenum depthFunc) @@ -402,18 +402,18 @@ void Context::setDepthRange(float zNear, float zFar) mState.zFar = zFar; } -void Context::setBlend(bool enabled) +void Context::setBlendEnabled(bool enabled) { - if(mState.blend != enabled) + if(mState.blendEnabled != enabled) { - mState.blend = enabled; + mState.blendEnabled = enabled; mBlendStateDirty = true; } } bool Context::isBlendEnabled() const { - return mState.blend; + return mState.blendEnabled; } void Context::setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha) @@ -457,25 +457,25 @@ void Context::setBlendEquation(GLenum rgbEquation, GLenum alphaEquation) } } -void Context::setStencilTest(bool enabled) +void Context::setStencilTestEnabled(bool enabled) { - if(mState.stencilTest != enabled) + if(mState.stencilTestEnabled != enabled) { - mState.stencilTest = enabled; + mState.stencilTestEnabled = enabled; mStencilStateDirty = true; } } bool Context::isStencilTestEnabled() const { - return mState.stencilTest; + return mState.stencilTestEnabled; } void Context::setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask) { if(mState.stencilFunc != stencilFunc || - mState.stencilRef != stencilRef || - mState.stencilMask != stencilMask) + mState.stencilRef != stencilRef || + mState.stencilMask != stencilMask) { mState.stencilFunc = stencilFunc; mState.stencilRef = (stencilRef > 0) ? stencilRef : 0; @@ -487,8 +487,8 @@ void Context::setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint sten void Context::setStencilBackParams(GLenum stencilBackFunc, GLint stencilBackRef, GLuint stencilBackMask) { if(mState.stencilBackFunc != stencilBackFunc || - mState.stencilBackRef != stencilBackRef || - mState.stencilBackMask != stencilBackMask) + mState.stencilBackRef != stencilBackRef || + mState.stencilBackMask != stencilBackMask) { mState.stencilBackFunc = stencilBackFunc; mState.stencilBackRef = (stencilBackRef > 0) ? stencilBackRef : 0; @@ -518,8 +518,8 @@ void Context::setStencilBackWritemask(GLuint stencilBackWritemask) void Context::setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass) { if(mState.stencilFail != stencilFail || - mState.stencilPassDepthFail != stencilPassDepthFail || - mState.stencilPassDepthPass != stencilPassDepthPass) + mState.stencilPassDepthFail != stencilPassDepthFail || + mState.stencilPassDepthPass != stencilPassDepthPass) { mState.stencilFail = stencilFail; mState.stencilPassDepthFail = stencilPassDepthFail; @@ -531,8 +531,8 @@ void Context::setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFa void Context::setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBackPassDepthFail, GLenum stencilBackPassDepthPass) { if(mState.stencilBackFail != stencilBackFail || - mState.stencilBackPassDepthFail != stencilBackPassDepthFail || - mState.stencilBackPassDepthPass != stencilBackPassDepthPass) + mState.stencilBackPassDepthFail != stencilBackPassDepthFail || + mState.stencilBackPassDepthPass != stencilBackPassDepthPass) { mState.stencilBackFail = stencilBackFail; mState.stencilBackPassDepthFail = stencilBackPassDepthFail; @@ -541,24 +541,24 @@ void Context::setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBac } } -void Context::setPolygonOffsetFill(bool enabled) +void Context::setPolygonOffsetFillEnabled(bool enabled) { - if(mState.polygonOffsetFill != enabled) + if(mState.polygonOffsetFillEnabled != enabled) { - mState.polygonOffsetFill = enabled; + mState.polygonOffsetFillEnabled = enabled; mPolygonOffsetStateDirty = true; } } bool Context::isPolygonOffsetFillEnabled() const { - return mState.polygonOffsetFill; + return mState.polygonOffsetFillEnabled; } void Context::setPolygonOffsetParams(GLfloat factor, GLfloat units) { if(mState.polygonOffsetFactor != factor || - mState.polygonOffsetUnits != units) + mState.polygonOffsetUnits != units) { mState.polygonOffsetFactor = factor; mState.polygonOffsetUnits = units; @@ -566,38 +566,38 @@ void Context::setPolygonOffsetParams(GLfloat factor, GLfloat units) } } -void Context::setSampleAlphaToCoverage(bool enabled) +void Context::setSampleAlphaToCoverageEnabled(bool enabled) { - if(mState.sampleAlphaToCoverage != enabled) + if(mState.sampleAlphaToCoverageEnabled != enabled) { - mState.sampleAlphaToCoverage = enabled; + mState.sampleAlphaToCoverageEnabled = enabled; mSampleStateDirty = true; } } bool Context::isSampleAlphaToCoverageEnabled() const { - return mState.sampleAlphaToCoverage; + return mState.sampleAlphaToCoverageEnabled; } -void Context::setSampleCoverage(bool enabled) +void Context::setSampleCoverageEnabled(bool enabled) { - if(mState.sampleCoverage != enabled) + if(mState.sampleCoverageEnabled != enabled) { - mState.sampleCoverage = enabled; + mState.sampleCoverageEnabled = enabled; mSampleStateDirty = true; } } bool Context::isSampleCoverageEnabled() const { - return mState.sampleCoverage; + return mState.sampleCoverageEnabled; } void Context::setSampleCoverageParams(GLclampf value, bool invert) { if(mState.sampleCoverageValue != value || - mState.sampleCoverageInvert != invert) + mState.sampleCoverageInvert != invert) { mState.sampleCoverageValue = value; mState.sampleCoverageInvert = invert; @@ -605,50 +605,50 @@ void Context::setSampleCoverageParams(GLclampf value, bool invert) } } -void Context::setScissorTest(bool enabled) +void Context::setScissorTestEnabled(bool enabled) { - mState.scissorTest = enabled; + mState.scissorTestEnabled = enabled; } bool Context::isScissorTestEnabled() const { - return mState.scissorTest; + return mState.scissorTestEnabled; } -void Context::setDither(bool enabled) +void Context::setDitherEnabled(bool enabled) { - if(mState.dither != enabled) + if(mState.ditherEnabled != enabled) { - mState.dither = enabled; + mState.ditherEnabled = enabled; mDitherStateDirty = true; } } bool Context::isDitherEnabled() const { - return mState.dither; + return mState.ditherEnabled; } -void Context::setPrimitiveRestartFixedIndex(bool enabled) +void Context::setPrimitiveRestartFixedIndexEnabled(bool enabled) { UNIMPLEMENTED(); - mState.primitiveRestartFixedIndex = enabled; + mState.primitiveRestartFixedIndexEnabled = enabled; } bool Context::isPrimitiveRestartFixedIndexEnabled() const { - return mState.primitiveRestartFixedIndex; + return mState.primitiveRestartFixedIndexEnabled; } -void Context::setRasterizerDiscard(bool enabled) +void Context::setRasterizerDiscardEnabled(bool enabled) { UNIMPLEMENTED(); - mState.rasterizerDiscard = enabled; + mState.rasterizerDiscardEnabled = enabled; } bool Context::isRasterizerDiscardEnabled() const { - return mState.rasterizerDiscard; + return mState.rasterizerDiscardEnabled; } void Context::setLineWidth(GLfloat width) @@ -792,7 +792,7 @@ GLuint Context::getActiveQuery(GLenum target) const return 0; } -void Context::setEnableVertexAttribArray(unsigned int attribNum, bool enabled) +void Context::setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled) { getCurrentVertexArray()->enableAttribute(attribNum, enabled); } @@ -1827,17 +1827,17 @@ bool Context::getBooleanv(GLenum pname, GLboolean *params) const params[2] = mState.colorMaskBlue; params[3] = mState.colorMaskAlpha; break; - case GL_CULL_FACE: *params = mState.cullFace; break; - case GL_POLYGON_OFFSET_FILL: *params = mState.polygonOffsetFill; break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: *params = mState.sampleAlphaToCoverage; break; - case GL_SAMPLE_COVERAGE: *params = mState.sampleCoverage; break; - case GL_SCISSOR_TEST: *params = mState.scissorTest; break; - case GL_STENCIL_TEST: *params = mState.stencilTest; break; - case GL_DEPTH_TEST: *params = mState.depthTest; break; - case GL_BLEND: *params = mState.blend; break; - case GL_DITHER: *params = mState.dither; break; - case GL_PRIMITIVE_RESTART_FIXED_INDEX: *params = mState.primitiveRestartFixedIndex; break; - case GL_RASTERIZER_DISCARD: *params = mState.rasterizerDiscard; break; + case GL_CULL_FACE: *params = mState.cullFaceEnabled; break; + case GL_POLYGON_OFFSET_FILL: *params = mState.polygonOffsetFillEnabled; break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: *params = mState.sampleAlphaToCoverageEnabled; break; + case GL_SAMPLE_COVERAGE: *params = mState.sampleCoverageEnabled; break; + case GL_SCISSOR_TEST: *params = mState.scissorTestEnabled; break; + case GL_STENCIL_TEST: *params = mState.stencilTestEnabled; break; + case GL_DEPTH_TEST: *params = mState.depthTestEnabled; break; + case GL_BLEND: *params = mState.blendEnabled; break; + case GL_DITHER: *params = mState.ditherEnabled; break; + case GL_PRIMITIVE_RESTART_FIXED_INDEX: *params = mState.primitiveRestartFixedIndexEnabled; break; + case GL_RASTERIZER_DISCARD: *params = mState.rasterizerDiscardEnabled; break; case GL_TRANSFORM_FEEDBACK_ACTIVE: { TransformFeedback* transformFeedback = getTransformFeedback(mState.transformFeedback); @@ -2683,7 +2683,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu void Context::applyScissor(int width, int height) { - if(mState.scissorTest) + if(mState.scissorTestEnabled) { sw::Rect scissor = { mState.scissorX, mState.scissorY, mState.scissorX + mState.scissorWidth, mState.scissorY + mState.scissorHeight }; scissor.clip(0, 0, width, height); @@ -2761,7 +2761,7 @@ void Context::applyState(GLenum drawMode) { Framebuffer *framebuffer = getDrawFramebuffer(); - if(mState.cullFace) + if(mState.cullFaceEnabled) { device->setCullMode(es2sw::ConvertCullMode(mState.cullMode, mState.frontFace)); } @@ -2772,7 +2772,7 @@ void Context::applyState(GLenum drawMode) if(mDepthStateDirty) { - if(mState.depthTest) + if(mState.depthTestEnabled) { device->setDepthBufferEnable(true); device->setDepthCompare(es2sw::ConvertDepthComparison(mState.depthFunc)); @@ -2787,7 +2787,7 @@ void Context::applyState(GLenum drawMode) if(mBlendStateDirty) { - if(mState.blend) + if(mState.blendEnabled) { device->setAlphaBlendEnable(true); device->setSeparateAlphaBlendEnable(true); @@ -2812,7 +2812,7 @@ void Context::applyState(GLenum drawMode) if(mStencilStateDirty || mFrontFaceDirty) { - if(mState.stencilTest && framebuffer->hasStencil()) + if(mState.stencilTestEnabled && framebuffer->hasStencil()) { device->setStencilEnable(true); device->setTwoSidedStencil(true); @@ -2885,7 +2885,7 @@ void Context::applyState(GLenum drawMode) if(mPolygonOffsetStateDirty) { - if(mState.polygonOffsetFill) + if(mState.polygonOffsetFillEnabled) { Renderbuffer *depthbuffer = framebuffer->getDepthbuffer(); if(depthbuffer) @@ -2906,7 +2906,7 @@ void Context::applyState(GLenum drawMode) if(mSampleStateDirty) { - if(mState.sampleAlphaToCoverage) + if(mState.sampleAlphaToCoverageEnabled) { device->setTransparencyAntialiasing(sw::TRANSPARENCY_ALPHA_TO_COVERAGE); } @@ -2915,7 +2915,7 @@ void Context::applyState(GLenum drawMode) device->setTransparencyAntialiasing(sw::TRANSPARENCY_NONE); } - if(mState.sampleCoverage) + if(mState.sampleCoverageEnabled) { unsigned int mask = 0; if(mState.sampleCoverageValue != 0) @@ -3984,7 +3984,7 @@ void Context::detachSampler(GLuint sampler) bool Context::cullSkipsDraw(GLenum drawMode) { - return mState.cullFace && mState.cullMode == GL_FRONT_AND_BACK && isTriangleMode(drawMode); + return mState.cullFaceEnabled && mState.cullMode == GL_FRONT_AND_BACK && isTriangleMode(drawMode); } bool Context::isTriangleMode(GLenum drawMode) @@ -4106,7 +4106,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 sw::Rect sourceScissoredRect = sourceRect; sw::Rect destScissoredRect = destRect; - if(mState.scissorTest) // Only write to parts of the destination framebuffer which pass the scissor test + if(mState.scissorTestEnabled) // Only write to parts of the destination framebuffer which pass the scissor test { if(destRect.x0 < mState.scissorX) { diff --git a/src/OpenGL/libGLESv2/Context.h b/src/OpenGL/libGLESv2/Context.h index 7232b9869..87209a1d4 100644 --- a/src/OpenGL/libGLESv2/Context.h +++ b/src/OpenGL/libGLESv2/Context.h @@ -140,7 +140,7 @@ struct Color // Helper structure describing a single vertex attribute class VertexAttribute { - public: +public: VertexAttribute() : mType(GL_FLOAT), mSize(0), mNormalized(false), mStride(0), mDivisor(0), mPointer(NULL), mArrayEnabled(false) { mCurrentValue[0].f = 0.0f; @@ -245,6 +245,7 @@ class VertexAttribute gl::BindingPointer mBoundBuffer; // Captured when glVertexAttribPointer is called. bool mArrayEnabled; // From glEnable/DisableVertexAttribArray + private: union ValueUnion { @@ -254,6 +255,7 @@ private: GLint i; GLuint ui; }; + ValueUnion mCurrentValue[4]; // From glVertexAttrib ValueUnion::Type mCurrentValueType; }; @@ -267,12 +269,12 @@ struct State GLclampf depthClearValue; int stencilClearValue; - bool cullFace; + bool cullFaceEnabled; GLenum cullMode; GLenum frontFace; - bool depthTest; + bool depthTestEnabled; GLenum depthFunc; - bool blend; + bool blendEnabled; GLenum sourceBlendRGB; GLenum destBlendRGB; GLenum sourceBlendAlpha; @@ -280,7 +282,7 @@ struct State GLenum blendEquationRGB; GLenum blendEquationAlpha; Color blendColor; - bool stencilTest; + bool stencilTestEnabled; GLenum stencilFunc; GLint stencilRef; GLuint stencilMask; @@ -295,18 +297,18 @@ struct State GLenum stencilBackPassDepthFail; GLenum stencilBackPassDepthPass; GLuint stencilBackWritemask; - bool polygonOffsetFill; + bool polygonOffsetFillEnabled; GLfloat polygonOffsetFactor; GLfloat polygonOffsetUnits; - bool sampleAlphaToCoverage; - bool sampleCoverage; + bool sampleAlphaToCoverageEnabled; + bool sampleCoverageEnabled; GLclampf sampleCoverageValue; bool sampleCoverageInvert; - bool scissorTest; - bool dither; - bool primitiveRestartFixedIndex; - bool rasterizerDiscard; - bool colorLogicOp; + bool scissorTestEnabled; + bool ditherEnabled; + bool primitiveRestartFixedIndexEnabled; + bool rasterizerDiscardEnabled; + bool colorLogicOpEnabled; GLenum logicalOperation; GLfloat lineWidth; @@ -377,23 +379,23 @@ public: void setClearDepth(float depth); void setClearStencil(int stencil); - void setCullFace(bool enabled); + void setCullFaceEnabled(bool enabled); bool isCullFaceEnabled() const; void setCullMode(GLenum mode); void setFrontFace(GLenum front); - void setDepthTest(bool enabled); + void setDepthTestEnabled(bool enabled); bool isDepthTestEnabled() const; void setDepthFunc(GLenum depthFunc); void setDepthRange(float zNear, float zFar); - void setBlend(bool enabled); + void setBlendEnabled(bool enabled); bool isBlendEnabled() const; void setBlendFactors(GLenum sourceRGB, GLenum destRGB, GLenum sourceAlpha, GLenum destAlpha); void setBlendColor(float red, float green, float blue, float alpha); void setBlendEquation(GLenum rgbEquation, GLenum alphaEquation); - void setStencilTest(bool enabled); + void setStencilTestEnabled(bool enabled); bool isStencilTestEnabled() const; void setStencilParams(GLenum stencilFunc, GLint stencilRef, GLuint stencilMask); void setStencilBackParams(GLenum stencilBackFunc, GLint stencilBackRef, GLuint stencilBackMask); @@ -402,23 +404,23 @@ public: void setStencilOperations(GLenum stencilFail, GLenum stencilPassDepthFail, GLenum stencilPassDepthPass); void setStencilBackOperations(GLenum stencilBackFail, GLenum stencilBackPassDepthFail, GLenum stencilBackPassDepthPass); - void setPolygonOffsetFill(bool enabled); + void setPolygonOffsetFillEnabled(bool enabled); bool isPolygonOffsetFillEnabled() const; void setPolygonOffsetParams(GLfloat factor, GLfloat units); - void setSampleAlphaToCoverage(bool enabled); + void setSampleAlphaToCoverageEnabled(bool enabled); bool isSampleAlphaToCoverageEnabled() const; - void setSampleCoverage(bool enabled); + void setSampleCoverageEnabled(bool enabled); bool isSampleCoverageEnabled() const; void setSampleCoverageParams(GLclampf value, bool invert); - void setDither(bool enabled); + void setDitherEnabled(bool enabled); bool isDitherEnabled() const; - void setPrimitiveRestartFixedIndex(bool enabled); + void setPrimitiveRestartFixedIndexEnabled(bool enabled); bool isPrimitiveRestartFixedIndexEnabled() const; - void setRasterizerDiscard(bool enabled); + void setRasterizerDiscardEnabled(bool enabled); bool isRasterizerDiscardEnabled() const; void setLineWidth(GLfloat width); @@ -428,7 +430,7 @@ public: void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height); - void setScissorTest(bool enabled); + void setScissorTestEnabled(bool enabled); bool isScissorTestEnabled() const; void setScissorParams(GLint x, GLint y, GLsizei width, GLsizei height); @@ -451,7 +453,7 @@ public: GLuint getArrayBufferName() const; GLuint getElementArrayBufferName() const; - void setEnableVertexAttribArray(unsigned int attribNum, bool enabled); + void setVertexAttribArrayEnabled(unsigned int attribNum, bool enabled); void setVertexAttribDivisor(unsigned int attribNum, GLuint divisor); const VertexAttribute &getVertexAttribState(unsigned int attribNum) const; void setVertexAttribState(unsigned int attribNum, Buffer *boundBuffer, GLint size, GLenum type, diff --git a/src/OpenGL/libGLESv2/libGLESv2.cpp b/src/OpenGL/libGLESv2/libGLESv2.cpp index 7e5a36939..946d7ad27 100644 --- a/src/OpenGL/libGLESv2/libGLESv2.cpp +++ b/src/OpenGL/libGLESv2/libGLESv2.cpp @@ -1713,17 +1713,17 @@ void Disable(GLenum cap) { switch(cap) { - case GL_CULL_FACE: context->setCullFace(false); break; - case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFill(false); break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverage(false); break; - case GL_SAMPLE_COVERAGE: context->setSampleCoverage(false); break; - case GL_SCISSOR_TEST: context->setScissorTest(false); break; - case GL_STENCIL_TEST: context->setStencilTest(false); break; - case GL_DEPTH_TEST: context->setDepthTest(false); break; - case GL_BLEND: context->setBlend(false); break; - case GL_DITHER: context->setDither(false); break; - case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndex(false); break; - case GL_RASTERIZER_DISCARD: context->setRasterizerDiscard(false); break; + case GL_CULL_FACE: context->setCullFaceEnabled(false); break; + case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFillEnabled(false); break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverageEnabled(false); break; + case GL_SAMPLE_COVERAGE: context->setSampleCoverageEnabled(false); break; + case GL_SCISSOR_TEST: context->setScissorTestEnabled(false); break; + case GL_STENCIL_TEST: context->setStencilTestEnabled(false); break; + case GL_DEPTH_TEST: context->setDepthTestEnabled(false); break; + case GL_BLEND: context->setBlendEnabled(false); break; + case GL_DITHER: context->setDitherEnabled(false); break; + case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndexEnabled(false); break; + case GL_RASTERIZER_DISCARD: context->setRasterizerDiscardEnabled(false); break; default: return error(GL_INVALID_ENUM); } @@ -1743,7 +1743,7 @@ void DisableVertexAttribArray(GLuint index) if(context) { - context->setEnableVertexAttribArray(index, false); + context->setVertexAttribArrayEnabled(index, false); } } @@ -2058,17 +2058,17 @@ void Enable(GLenum cap) { switch(cap) { - case GL_CULL_FACE: context->setCullFace(true); break; - case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFill(true); break; - case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverage(true); break; - case GL_SAMPLE_COVERAGE: context->setSampleCoverage(true); break; - case GL_SCISSOR_TEST: context->setScissorTest(true); break; - case GL_STENCIL_TEST: context->setStencilTest(true); break; - case GL_DEPTH_TEST: context->setDepthTest(true); break; - case GL_BLEND: context->setBlend(true); break; - case GL_DITHER: context->setDither(true); break; - case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndex(true); break; - case GL_RASTERIZER_DISCARD: context->setRasterizerDiscard(true); break; + case GL_CULL_FACE: context->setCullFaceEnabled(true); break; + case GL_POLYGON_OFFSET_FILL: context->setPolygonOffsetFillEnabled(true); break; + case GL_SAMPLE_ALPHA_TO_COVERAGE: context->setSampleAlphaToCoverageEnabled(true); break; + case GL_SAMPLE_COVERAGE: context->setSampleCoverageEnabled(true); break; + case GL_SCISSOR_TEST: context->setScissorTestEnabled(true); break; + case GL_STENCIL_TEST: context->setStencilTestEnabled(true); break; + case GL_DEPTH_TEST: context->setDepthTestEnabled(true); break; + case GL_BLEND: context->setBlendEnabled(true); break; + case GL_DITHER: context->setDitherEnabled(true); break; + case GL_PRIMITIVE_RESTART_FIXED_INDEX: context->setPrimitiveRestartFixedIndexEnabled(true); break; + case GL_RASTERIZER_DISCARD: context->setRasterizerDiscardEnabled(true); break; default: return error(GL_INVALID_ENUM); } @@ -2088,7 +2088,7 @@ void EnableVertexAttribArray(GLuint index) if(context) { - context->setEnableVertexAttribArray(index, true); + context->setVertexAttribArrayEnabled(index, true); } } -- 2.11.0