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

@@ -267,6 +267,19 @@ bool NzShader::LoadFromFile(nzShaderType type, const NzString& filePath)
return m_impl->Load(type, source);
}
bool NzShader::Lock()
{
#if NAZARA_RENDERER_SAFE
if (!m_impl)
{
NazaraError("Shader not created");
return false;
}
#endif
return m_impl->Lock();
}
bool NzShader::SendBoolean(const NzString& name, bool value)
{
#if NAZARA_RENDERER_SAFE
@@ -357,6 +370,19 @@ bool NzShader::SendMatrix(const NzString& name, const NzMatrix4f& matrix)
return m_impl->SendMatrix(name, matrix);
}
void NzShader::Unlock()
{
#if NAZARA_RENDERER_SAFE
if (!m_impl)
{
NazaraError("Shader not created");
return;
}
#endif
return m_impl->Unlock();
}
bool NzShader::IsLanguageSupported(nzShaderLanguage language)
{
switch (language)