summaryrefslogtreecommitdiff
path: root/src/render/shaders
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/shaders
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/shaders')
-rw-r--r--src/render/shaders/shadersmanager.cpp7
-rw-r--r--src/render/shaders/shadersmanager.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/render/shaders/shadersmanager.cpp b/src/render/shaders/shadersmanager.cpp
index e6b5c7181..f9c305d79 100644
--- a/src/render/shaders/shadersmanager.cpp
+++ b/src/render/shaders/shadersmanager.cpp
@@ -22,6 +22,7 @@
#ifdef USE_OPENGL
+#include "configuration.h"
#include "logger.h"
#include "settings.h"
@@ -111,4 +112,10 @@ ShaderProgram *ShadersManager::createProgram(const std::string &vertex,
return nullptr;
}
+ShaderProgram *ShadersManager::getSimpleProgram()
+{
+ const std::string dir = paths.getStringValue("shaders");
+ return createProgram(dir + paths.getStringValue("simpleVertexShader"),
+ dir + paths.getStringValue("simpleFragmentShader"));
+}
#endif
diff --git a/src/render/shaders/shadersmanager.h b/src/render/shaders/shadersmanager.h
index ba7d26438..50e714aba 100644
--- a/src/render/shaders/shadersmanager.h
+++ b/src/render/shaders/shadersmanager.h
@@ -39,6 +39,8 @@ class ShadersManager final
ShaderProgram *createProgram(const std::string &vertex,
const std::string &fragment)
A_WARN_UNUSED;
+
+ ShaderProgram *getSimpleProgram();
};
extern ShadersManager shaders;