Added move constructor/operator to Shader

Former-commit-id: b947e0ac0dcddcfe64c83b63cf89df0e0850cbd2
This commit is contained in:
Lynix
2013-01-08 17:31:42 +01:00
parent e194d11374
commit e6cef2ddbf
2 changed files with 19 additions and 0 deletions

View File

@@ -19,6 +19,12 @@ NzShader::NzShader(nzShaderLanguage language)
Create(language);
}
NzShader::NzShader(NzShader&& shader) :
m_impl(shader.m_impl)
{
shader.m_impl = nullptr;
}
NzShader::~NzShader()
{
Destroy();
@@ -609,6 +615,16 @@ void NzShader::Unlock()
return m_impl->Unlock();
}
NzShader& NzShader::operator=(NzShader&& shader)
{
Destroy();
m_impl = shader.m_impl;
shader.m_impl = nullptr;
return *this;
}
bool NzShader::IsLanguageSupported(nzShaderLanguage language)
{
switch (language)