From 7a0767fd5b888ddbf7d5dbd862dc0063350145aa Mon Sep 17 00:00:00 2001 From: Cruel Date: Mon, 17 Aug 2015 14:00:21 -0400 Subject: [PATCH] Shader loadProgram => loadBinary --- include/cpp3ds/Graphics/Shader.hpp | 6 +++--- src/cpp3ds/Graphics/Shader.cpp | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/cpp3ds/Graphics/Shader.hpp b/include/cpp3ds/Graphics/Shader.hpp index b102bbd..06d15c7 100644 --- a/include/cpp3ds/Graphics/Shader.hpp +++ b/include/cpp3ds/Graphics/Shader.hpp @@ -140,7 +140,7 @@ public : //////////////////////////////////////////////////////////// bool loadFromFile(const std::string& vertexShaderFilename, const std::string& fragmentShaderFilename); - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// /// \brief Load either the vertex or fragment shader from a source code in memory /// /// This function loads a single shader, either vertex or @@ -183,6 +183,8 @@ public : bool loadFromResource(const std::string& vertexShader, Type type, bool compiled = true); + bool loadBinary(const Uint8* data, const Uint32 size); + //////////////////////////////////////////////////////////// /// \brief Load either the vertex or fragment shader from a custom stream /// @@ -524,8 +526,6 @@ private : //////////////////////////////////////////////////////////// bool compile(const char* vertexShaderCode, const char* fragmentShaderCode); - bool loadProgram(const Uint8* data, const Uint32 size); - //////////////////////////////////////////////////////////// /// \brief Bind all the textures used by the shader /// diff --git a/src/cpp3ds/Graphics/Shader.cpp b/src/cpp3ds/Graphics/Shader.cpp index 6fcce5c..9ec6854 100644 --- a/src/cpp3ds/Graphics/Shader.cpp +++ b/src/cpp3ds/Graphics/Shader.cpp @@ -37,8 +37,6 @@ #include -// OpenGL ES 1 does't support GLSL shaders at all, we have to provide an empty implementation - namespace cpp3ds { //////////////////////////////////////////////////////////// @@ -95,7 +93,7 @@ bool Shader::loadFromMemory(const std::string& vertexShader, const std::string& bool Shader::loadFromResource(const std::string& vertexShader, Type type, bool compiled) { if (compiled) { - return loadProgram(priv::resources[vertexShader].data, priv::resources[vertexShader].size); + return loadBinary(priv::resources[vertexShader].data, priv::resources[vertexShader].size); } else { return compile(vertexShader.c_str(), nullptr); } @@ -353,7 +351,7 @@ bool Shader::compile(const char* vertexShaderCode, const char* fragmentShaderCod //////////////////////////////////////////////////////////// -bool Shader::loadProgram(const Uint8* data, const Uint32 size) +bool Shader::loadBinary(const Uint8* data, const Uint32 size) { if (m_shaderProgram) { glCheck(glDeleteProgram(m_shaderProgram));