Files
Z3D/source/opengl/data/shader_data.ipp
2025-03-22 17:40:08 +01:00

38 lines
603 B
C++

#ifndef INCLUDE_SHADER_DATA_IMPLEMENTATION
# error Never include this file directly include 'shader_data.hpp'
#endif
namespace zgl
{
inline shader_data::shader_data(const GLuint id) :
handle{ id } {}
inline shader_data::shader_data(shader_data&& other) noexcept
{
handle = other.handle;
other.handle.id = 0;
}
inline shader_data& shader_data::operator=(shader_data&& other) noexcept
{
if (&other != this)
{
this->~shader_data();
handle = other.handle;
other.handle.id = 0;
}
return *this;
}
inline shader_data::~shader_data()
{
if (handle.id)
{
glDeleteShader(handle.id);
}
}
}