It is now possible to send uniforms to shader when they are not mounted; Added shader locking

This commit is contained in:
Lynix
2012-05-04 08:56:35 +02:00
parent a4cbe46e15
commit a215920818
5 changed files with 77 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ class NzGLSLShader : public NzShaderImpl
bool IsLoaded(nzShaderType type) const;
bool Load(nzShaderType type, const NzString& source);
bool Lock() const;
bool SendBoolean(const NzString& name, bool value);
bool SendDouble(const NzString& name, double value);
@@ -43,13 +44,16 @@ class NzGLSLShader : public NzShaderImpl
bool SendMatrix(const NzString& name, const NzMatrix4f& matrix);
void Unbind();
void Unlock() const;
private:
bool UpdateVertexBuffer(const NzVertexBuffer* vertexBuffer, const NzVertexDeclaration* vertexDeclaration);
mutable std::map<NzString, GLint> m_idCache;
mutable GLuint m_lockedPrevious;
GLuint m_program;
GLuint m_shaders[nzShaderType_Count];
mutable nzUInt8 m_lockedLevel;
NzShader* m_parent;
NzString m_log;
};