summaryrefslogtreecommitdiff
path: root/src/render/modernopenglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-08 18:38:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-08 18:38:07 +0300
commit7a0ce777e5d7e3c5ba562ea1c811c0c3cb17a976 (patch)
tree04528345be1561b7970b4c1f1c6e1693e5e2f84e /src/render/modernopenglgraphics.cpp
parente7f05704102d204ce73f97bca5f62312adcd1c2b (diff)
downloadmanaplus-7a0ce777e5d7e3c5ba562ea1c811c0c3cb17a976.tar.gz
manaplus-7a0ce777e5d7e3c5ba562ea1c811c0c3cb17a976.tar.bz2
manaplus-7a0ce777e5d7e3c5ba562ea1c811c0c3cb17a976.tar.xz
manaplus-7a0ce777e5d7e3c5ba562ea1c811c0c3cb17a976.zip
Add simple shader creation.
Diffstat (limited to 'src/render/modernopenglgraphics.cpp')
-rw-r--r--src/render/modernopenglgraphics.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp
index 2b771a2bb..566dec714 100644
--- a/src/render/modernopenglgraphics.cpp
+++ b/src/render/modernopenglgraphics.cpp
@@ -33,6 +33,9 @@
#include "render/mgl.h"
+#include "render/shaders/shaderprogram.h"
+#include "render/shaders/shadersmanager.h"
+
#include "resources/image.h"
#include "resources/imagerect.h"
#include "resources/openglimagehelper.h"
@@ -52,6 +55,7 @@ ModernOpenGLGraphics::ModernOpenGLGraphics() :
mShortVertArray(nullptr),
mFloatTexArrayCached(nullptr),
mShortVertArrayCached(nullptr),
+ mSimpleProgram(nullptr),
mAlphaCached(1.0F),
mVpCached(0),
mTexture(false),
@@ -97,6 +101,16 @@ void ModernOpenGLGraphics::initArrays(const int vertCount)
mShortVertArrayCached = new GLshort[sz];
}
+void ModernOpenGLGraphics::postInit()
+{
+ logger->log("Compiling shaders");
+ mSimpleProgram = shaders.getSimpleProgram();
+ if (mSimpleProgram)
+ logger->log("Shaders compilation done.");
+ else
+ logger->error("Shaders compilation error.");
+}
+
void ModernOpenGLGraphics::deleteArrays()
{
deleteArraysInternal();