23 lines
631 B
C++
23 lines
631 B
C++
#include "OGLObjects.hpp"
|
|
|
|
namespace nb {
|
|
|
|
const std::string OGLError::type = "nb::OGLError";
|
|
const ErrorCodeMap OGLError::ErrorMessages = {
|
|
{ OGLError::Codes::UNDEFINED, "Error" },
|
|
{OGLError::Codes::HANGING_OBJECT, "Attempting to leave a hanging OpenGL object"},
|
|
{OGLError::Codes::INVALID_OBJECT, "Attempting operation with invalid object"}
|
|
};
|
|
|
|
OpenGLObject::OpenGLObject(OpenGLObject&& rval) {
|
|
*this = std::move(rval);
|
|
}
|
|
|
|
OpenGLObject& OpenGLObject::operator=(OpenGLObject&& rhs) {
|
|
if (_id) { THROW(OGLError(Codes::HANGING_OBJECT)); }
|
|
_id = rhs._id;
|
|
rhs._id = 0;
|
|
return *this;
|
|
}
|
|
|
|
} // namespace nb
|