This commit is contained in:
ZY4N
2025-03-23 21:11:22 +01:00
parent 510398423a
commit c609d49f0d
49 changed files with 1412 additions and 924 deletions

View File

@@ -11,13 +11,13 @@
namespace zgl
{
inline shader_program_data::shader_program_data(GLuint program_id)
: m_handle{ program_id } {}
: handle{ program_id } {}
inline shader_program_data::shader_program_data(shader_program_data&& other) noexcept
{
m_handle = other.m_handle;
other.m_handle.program_id = 0;
handle = other.handle;
other.handle.id = 0;
}
inline shader_program_data& shader_program_data::operator=(shader_program_data&& other) noexcept
@@ -25,21 +25,16 @@ inline shader_program_data& shader_program_data::operator=(shader_program_data&&
if (&other != this)
{
this->~shader_program_data();
m_handle = other.m_handle;
other.m_handle.program_id = 0;
handle = other.handle;
other.handle.id = 0;
}
return *this;
}
inline shader_program_data::~shader_program_data()
{
if (m_handle.program_id) {
glDeleteProgram(m_handle.program_id);
if (handle.id) {
glDeleteProgram(handle.id);
}
}
[[nodiscard]] inline shader_program_handle shader_program_data::handle() const
{
return m_handle;
}
}