summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-10 02:59:18 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-10 15:12:12 +0300
commit740b10240414ae3b7c37ee21fd131ffdb296b2b9 (patch)
treeb1c03b4c9eeb8790033c79cece88162597711fbb /src/resources
parent54d0234c8334bcd61ffb655a57e6147fd279b9e1 (diff)
downloadmanaverse-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.gz
manaverse-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.bz2
manaverse-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.xz
manaverse-740b10240414ae3b7c37ee21fd131ffdb296b2b9.zip
Add function for load OpenGL ES 2 shaders.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/resourcemanager.cpp10
-rw-r--r--src/resources/resourcemanager.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index f9f55ca03..bb566d9f4 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -763,6 +763,7 @@ struct ShaderProgramLoader final
{
const std::string vertex;
const std::string fragment;
+ const bool isNewShader;
static Resource *load(const void *const v)
{
@@ -772,15 +773,18 @@ struct ShaderProgramLoader final
const ShaderProgramLoader *const rl
= static_cast<const ShaderProgramLoader *const>(v);
ShaderProgram *const resource = shaders.createProgram(
- rl->vertex, rl->fragment);
+ rl->vertex,
+ rl->fragment,
+ rl->isNewShader);
return resource;
}
};
Resource *ResourceManager::getShaderProgram(const std::string &vertex,
- const std::string &fragment)
+ const std::string &fragment,
+ const bool isNewShader)
{
- ShaderProgramLoader rl = { vertex, fragment };
+ ShaderProgramLoader rl = { vertex, fragment, isNewShader };
return get("program_" + vertex + " + " + fragment,
ShaderProgramLoader::load, &rl);
}
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 13d05f0b2..329820246 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -181,7 +181,8 @@ class ResourceManager final
const std::string &name) A_WARN_UNUSED;
Resource *getShaderProgram(const std::string &vertex,
- const std::string &fragment) A_WARN_UNUSED;
+ const std::string &fragment,
+ const bool isNewShader) A_WARN_UNUSED;
#endif
WalkLayer *getWalkLayer(const std::string &name, Map *const map);