From dc2ec44f4c1ee977c0a911d6c343e15a9729e4e7 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Tue, 6 Feb 2018 00:00:23 +0800 Subject: Remove nonsense. Documentation work in progress. --- smelt/glfw_m/gfx_glfw.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'smelt') 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; -- cgit v1.2.3