diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-10 02:59:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-10 15:12:12 +0300 |
commit | 740b10240414ae3b7c37ee21fd131ffdb296b2b9 (patch) | |
tree | b1c03b4c9eeb8790033c79cece88162597711fbb /src/resources/resourcemanager.cpp | |
parent | 54d0234c8334bcd61ffb655a57e6147fd279b9e1 (diff) | |
download | mv-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.gz mv-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.bz2 mv-740b10240414ae3b7c37ee21fd131ffdb296b2b9.tar.xz mv-740b10240414ae3b7c37ee21fd131ffdb296b2b9.zip |
Add function for load OpenGL ES 2 shaders.
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r-- | src/resources/resourcemanager.cpp | 10 |
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); } |