aboutsummaryrefslogtreecommitdiff
path: root/smelt
diff options
context:
space:
mode:
Diffstat (limited to 'smelt')
-rw-r--r--smelt/glfw_m/gfx_glfw.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/smelt/glfw_m/gfx_glfw.cpp b/smelt/glfw_m/gfx_glfw.cpp
index 41b4d7b..4f69a40 100644
--- a/smelt/glfw_m/gfx_glfw.cpp
+++ b/smelt/glfw_m/gfx_glfw.cpp
@@ -907,21 +907,18 @@ void SMELT_IMPL::finiOGL()
delete[] indexBuf;indexBuf=NULL;
if(pOpenGLDevice)
{
- if(1)
+ if(VertexBufferObject!=0)
{
- if(VertexBufferObject!=0)
- {
- glBindVertexArray(VertexArrayObject);
- glBindBuffer(GL_ARRAY_BUFFER,0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0);
- glDeleteBuffers(1,&VertexBufferObject);
- glDeleteBuffers(1,&IndexBufferObject);
- glBindVertexArray(0);
- glDeleteVertexArrays(1,&VertexArrayObject);
- VertexArrayObject=0;
- VertexBufferObject=0;
- IndexBufferObject=0;
- }
+ glBindVertexArray(VertexArrayObject);
+ glBindBuffer(GL_ARRAY_BUFFER,0);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0);
+ glDeleteBuffers(1,&VertexBufferObject);
+ glDeleteBuffers(1,&IndexBufferObject);
+ glBindVertexArray(0);
+ glDeleteVertexArrays(1,&VertexArrayObject);
+ VertexArrayObject=0;
+ VertexBufferObject=0;
+ IndexBufferObject=0;
}
glDeleteProgram(ShaderProgram);
delete pOpenGLDevice;