diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-10 20:25:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-10 20:25:14 +0300 |
commit | e26b6338465f2ca1b7e83ec715bcd7860916e56d (patch) | |
tree | 349c9c7dd77e592982e736bef1a9da1fbd2e42f3 | |
parent | a0760030ea6d9277c67fd15ab142ae66b40c7f5d (diff) | |
download | plus-e26b6338465f2ca1b7e83ec715bcd7860916e56d.tar.gz plus-e26b6338465f2ca1b7e83ec715bcd7860916e56d.tar.bz2 plus-e26b6338465f2ca1b7e83ec715bcd7860916e56d.tar.xz plus-e26b6338465f2ca1b7e83ec715bcd7860916e56d.zip |
test
-rw-r--r-- | src/render/modernopenglgraphics.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index 22c9beea7..349b7870b 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -137,10 +137,12 @@ void ModernOpenGLGraphics::postInit() void ModernOpenGLGraphics::screenResized() { - mglUniform2f(mSimpleScreenUniform, + mglProgramUniform2f(mSimpleProgramId, + mSimpleScreenUniform, static_cast<float>(mWidth) / 2.0f, static_cast<float>(mHeight) / 2.0f); - mglUniform2f(mTextureScreenUniform, + mglProgramUniform2f(mTextureProgramId, + mTextureScreenUniform, static_cast<float>(mWidth) / 2.0f, static_cast<float>(mHeight) / 2.0f); } @@ -182,9 +184,10 @@ void ModernOpenGLGraphics::setColorAll(const Color &color, mColor = color; mColor2 = color2; mColorAlpha = (color.a != 255); - if (mColorAlpha) + if (mTextureDraw) { - mglUniform4f(mSimpleColorUniform, + mglProgramUniform4f(mSimpleProgramId, + mSimpleColorUniform, static_cast<float>(color.r) / 255.0F, static_cast<float>(color.g) / 255.0F, static_cast<float>(color.b) / 255.0F, @@ -196,7 +199,7 @@ void ModernOpenGLGraphics::setColorAll(const Color &color, static_cast<float>(color.r) / 255.0F, static_cast<float>(color.g) / 255.0F, static_cast<float>(color.b) / 255.0F, - 1.0F); + static_cast<float>(color.a) / 255.0F); } } @@ -664,9 +667,11 @@ void ModernOpenGLGraphics::setTexturingAndBlending(const bool enable) mglUseProgram(mTextureProgramId); mglEnableVertexAttribArray(mTexturePosAttrib); mglEnableVertexAttribArray(mTexAttrib); +/* mglUniform2f(mTextureScreenUniform, static_cast<float>(mWidth) / 2.0f, static_cast<float>(mHeight) / 2.0f); +*/ } if (!mAlpha) { @@ -683,6 +688,7 @@ void ModernOpenGLGraphics::setTexturingAndBlending(const bool enable) mglDisableVertexAttribArray(mTexAttrib); mglUseProgram(mSimpleProgramId); mglEnableVertexAttribArray(mSimplePosAttrib); +/* mglUniform2f(mSimpleScreenUniform, static_cast<float>(mWidth) / 2.0f, static_cast<float>(mHeight) / 2.0f); @@ -691,6 +697,7 @@ void ModernOpenGLGraphics::setTexturingAndBlending(const bool enable) static_cast<float>(mColor.g) / 255.0F, static_cast<float>(mColor.b) / 255.0F, static_cast<float>(mColor.a) / 255.0F); +*/ } if (mAlpha && !mColorAlpha) { |