summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
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/resourcemanager.cpp
parent54d0234c8334bcd61ffb655a57e6147fd279b9e1 (diff)
downloadplus-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.gz
plus-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.bz2
plus-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.xz
plus-740b10240414ae3b7c37ee21fd131ffdb296b2b9.zip
Add function for load OpenGL ES 2 shaders.
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp10
1 files changed, 7 insertions, 3 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);
}