mirror of
https://github.com/encounter/cpp3ds.git
synced 2026-03-30 11:04:22 -07:00
Shader loadProgram => loadBinary
This commit is contained in:
@@ -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
|
||||
///
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user