浏览代码

Fix: [GL*sdlmax2d.mod] Only delete framebuffers if used

Ronny Otto 2 年之前
父节点
当前提交
885a118425
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 4 1
      gl2sdlmax2d.mod/main.bmx
  2. 4 1
      glsdlmax2d.mod/glsdlmax2d.bmx

+ 4 - 1
gl2sdlmax2d.mod/main.bmx

@@ -412,7 +412,10 @@ Type TGL2SDLRenderImageFrame Extends TGLImageFrame
 	
 	
 Private
 Private
 	Method Delete()
 	Method Delete()
-		glDeleteFrameBuffers(1, Varptr FBO) ' gl ignores 0
+		'remove framebuffer if used
+		if FBO <> 0
+			glDeleteFramebuffers(1, Varptr FBO) ' gl ignores 0
+		EndIf
 	EndMethod
 	EndMethod
 
 
 	Method New()
 	Method New()

+ 4 - 1
glsdlmax2d.mod/glsdlmax2d.bmx

@@ -436,7 +436,10 @@ Type TGLSDLRenderImageFrame Extends TGLImageFrame
 	
 	
 Private
 Private
 	Method Delete()
 	Method Delete()
-		glDeleteFramebuffers(1, Varptr FBO) ' gl ignores 0
+		'remove framebuffer if used
+		if FBO <> 0
+			glDeleteFramebuffers(1, Varptr FBO) ' gl ignores 0
+		EndIf
 	End Method
 	End Method
 
 
 	Method New()
 	Method New()