Further shader compilation development.

This commit is contained in:
zy4n
2025-03-22 17:40:08 +01:00
parent e01b8c2e09
commit 510398423a
45 changed files with 1567 additions and 1097 deletions

View File

@@ -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;
}
}