Shader loadProgram => loadBinary

This commit is contained in:
Cruel
2015-08-17 14:00:21 -04:00
parent b4eca7f644
commit 7a0767fd5b
2 changed files with 5 additions and 7 deletions
+3 -3
View File
@@ -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
///
+2 -4
View File
@@ -37,8 +37,6 @@
#include <vector>
// 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));