Add extra checks to ebo, vao and vbo

This commit is contained in:
Linloir 2022-12-13 10:10:10 +08:00
parent e203ee0ff3
commit 58593822a3
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
3 changed files with 9 additions and 0 deletions

View File

@ -51,5 +51,8 @@ inline void ElementBufferObject::dispose() {
inline void ElementBufferObject::ensureInitialized() {
if (_id == 0) {
OPENGL_EXTRA_FUNCTIONS->glGenBuffers(1, &_id);
if (_id == 0) {
Logger::error("Failed to create ElementBufferObject");
}
}
}

View File

@ -60,6 +60,9 @@ inline void VertexArrayObject::dispose() {
inline void VertexArrayObject::ensureInitialized() {
if (_id == 0) {
OPENGL_EXTRA_FUNCTIONS->glGenVertexArrays(1, &_id);
if (_id == 0) {
Logger::error("Failed to create VertexArrayObject");
}
}
}

View File

@ -51,5 +51,8 @@ inline void VertexBufferObject::dispose() {
inline void VertexBufferObject::ensureInitialized() {
if (_id == 0) {
OPENGL_EXTRA_FUNCTIONS->glGenBuffers(1, &_id);
if (_id == 0) {
Logger::error("Failed to create VertexBufferObject");
}
}
}