mirror of
https://github.com/Linloir/SceneEditor.git
synced 2025-12-19 00:18:12 +08:00
Add id check when disposing ebo and vbo
This commit is contained in:
parent
58593822a3
commit
e02160435a
@ -44,6 +44,7 @@ inline void ElementBufferObject::unbind() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void ElementBufferObject::dispose() {
|
inline void ElementBufferObject::dispose() {
|
||||||
|
if (_id == 0) return;
|
||||||
OPENGL_EXTRA_FUNCTIONS->glDeleteBuffers(1, &_id);
|
OPENGL_EXTRA_FUNCTIONS->glDeleteBuffers(1, &_id);
|
||||||
_id = 0;
|
_id = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,7 @@ inline void VertexBufferObject::unbind() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void VertexBufferObject::dispose() {
|
inline void VertexBufferObject::dispose() {
|
||||||
|
if (_id == 0) return;
|
||||||
OPENGL_EXTRA_FUNCTIONS->glDeleteBuffers(1, &_id);
|
OPENGL_EXTRA_FUNCTIONS->glDeleteBuffers(1, &_id);
|
||||||
_id = 0;
|
_id = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user