Further shader compilation development.
This commit is contained in:
@@ -4,16 +4,14 @@
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
inline shader_data::shader_data(const GLuint shader_id, const GLenum type)
|
||||
: m_handle{ shader_id }, m_type{ type } {}
|
||||
inline shader_data::shader_data(const GLuint id) :
|
||||
handle{ id } {}
|
||||
|
||||
|
||||
inline shader_data::shader_data(shader_data&& other) noexcept
|
||||
{
|
||||
m_handle = other.m_handle;
|
||||
m_type = other.m_type;
|
||||
other.m_handle.shader_id = 0;
|
||||
other.m_type = GL_INVALID_ENUM;
|
||||
handle = other.handle;
|
||||
other.handle.id = 0;
|
||||
}
|
||||
|
||||
inline shader_data& shader_data::operator=(shader_data&& other) noexcept
|
||||
@@ -22,26 +20,18 @@ inline shader_data& shader_data::operator=(shader_data&& other) noexcept
|
||||
{
|
||||
this->~shader_data();
|
||||
|
||||
m_handle = other.m_handle;
|
||||
m_type = other.m_type;
|
||||
other.m_handle.shader_id = 0;
|
||||
other.m_type = GL_INVALID_ENUM;
|
||||
handle = other.handle;
|
||||
other.handle.id = 0;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline shader_data::~shader_data()
|
||||
{
|
||||
if (m_handle.shader_id)
|
||||
if (handle.id)
|
||||
{
|
||||
glDeleteShader(m_handle.shader_id);
|
||||
glDeleteShader(handle.id);
|
||||
}
|
||||
m_type = GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
inline shader_handle shader_data::handle() const
|
||||
{
|
||||
return m_handle;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user