[nostalgia/core/userland] Cleanup
This commit is contained in:
parent
18491dafd9
commit
239f4d149d
@ -9,6 +9,7 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
#include <ox/std/assert.hpp>
|
#include <ox/std/assert.hpp>
|
||||||
|
#include <ox/std/bstring.hpp>
|
||||||
#include <ox/std/trace.hpp>
|
#include <ox/std/trace.hpp>
|
||||||
|
|
||||||
#include "glutils.hpp"
|
#include "glutils.hpp"
|
||||||
@ -41,9 +42,9 @@ static ox::Result<Shader> buildShader(GLuint shaderType, const GLchar *src, cons
|
|||||||
GLint status;
|
GLint status;
|
||||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
||||||
if (status != GL_TRUE) {
|
if (status != GL_TRUE) {
|
||||||
std::array<char, 1000> errMsg;
|
ox::BString<1000> errMsg;
|
||||||
glGetShaderInfoLog(shader, errMsg.size(), nullptr, errMsg.data());
|
glGetShaderInfoLog(shader, errMsg.cap(), nullptr, errMsg.data());
|
||||||
oxErrorf("shader compile error in {}: {}", shaderName, errMsg.data());
|
oxErrorf("shader compile error in {}: {}", shaderName, errMsg);
|
||||||
return OxError(1, "shader compile error");
|
return OxError(1, "shader compile error");
|
||||||
}
|
}
|
||||||
return ox::move(shader);
|
return ox::move(shader);
|
||||||
|
@ -53,11 +53,11 @@ struct GLobject: public Base {
|
|||||||
|
|
||||||
constexpr GLobject() noexcept = default;
|
constexpr GLobject() noexcept = default;
|
||||||
|
|
||||||
explicit constexpr GLobject(GLuint id) {
|
explicit constexpr GLobject(GLuint id) noexcept {
|
||||||
this->id = id;
|
this->id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr GLobject(GLobject &&o): Base(ox::move(o)) {
|
constexpr GLobject(GLobject &&o) noexcept: Base(ox::move(o)) {
|
||||||
id = o.id;
|
id = o.id;
|
||||||
o.id = 0;
|
o.id = 0;
|
||||||
}
|
}
|
||||||
@ -66,11 +66,13 @@ struct GLobject: public Base {
|
|||||||
del(id);
|
del(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLobject &operator=(GLobject &&o) {
|
GLobject &operator=(GLobject &&o) noexcept {
|
||||||
this->~GLobject();
|
if (this != &o) {
|
||||||
|
del(id);
|
||||||
Base::operator=(ox::move(o));
|
Base::operator=(ox::move(o));
|
||||||
id = o.id;
|
id = o.id;
|
||||||
o.id = 0;
|
o.id = 0;
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user