Nicolas Cannasse %!s(int64=9) %!d(string=hai) anos
pai
achega
8a1c485318
Modificáronse 1 ficheiros con 12 adicións e 12 borrados
  1. 12 12
      h3d/impl/GlDriver.hx

+ 12 - 12
h3d/impl/GlDriver.hx

@@ -431,7 +431,7 @@ class GlDriver extends Driver {
 				gl.framebufferRenderbuffer(GL.FRAMEBUFFER, GL.DEPTH_ATTACHMENT, GL.RENDERBUFFER, tt.rb);
 				gl.framebufferRenderbuffer(GL.FRAMEBUFFER, GL.DEPTH_ATTACHMENT, GL.RENDERBUFFER, tt.rb);
 				gl.bindRenderbuffer(GL.RENDERBUFFER, null);
 				gl.bindRenderbuffer(GL.RENDERBUFFER, null);
 			}
 			}
-			gl.bindFramebuffer(GL.FRAMEBUFFER, curTarget == null ? null : curTarget.t.fb);
+			gl.bindFramebuffer(GL.FRAMEBUFFER, curTarget == null || curTarget.t == null ? null : curTarget.t.fb);
 		}
 		}
 		gl.bindTexture(GL.TEXTURE_2D, null);
 		gl.bindTexture(GL.TEXTURE_2D, null);
 		return tt;
 		return tt;
@@ -515,22 +515,22 @@ class GlDriver extends Driver {
 		#end
 		#end
 	}
 	}
 	#end
 	#end
-	
+
 	/*
 	/*
 		GL async model create crashes if the GC free the memory that we send it.
 		GL async model create crashes if the GC free the memory that we send it.
 		Instead, we will copy the data into a temp location before uploading.
 		Instead, we will copy the data into a temp location before uploading.
 	*/
 	*/
-	
+
 	static inline var STREAM_POS = #if hl 0 #else 1 #end;
 	static inline var STREAM_POS = #if hl 0 #else 1 #end;
 	#if hl
 	#if hl
-	
+
 	var streamBytes : hl.types.Bytes;
 	var streamBytes : hl.types.Bytes;
 	var streamLen : Int;
 	var streamLen : Int;
 	var streamPos : Int;
 	var streamPos : Int;
-	
+
 	function expandStream(needed:Int) {
 	function expandStream(needed:Int) {
 		GL.finish();
 		GL.finish();
-		
+
 		// too much data in our tmp buffer, let's flush it
 		// too much data in our tmp buffer, let's flush it
 		if( streamPos > (needed >> 1) && needed > 16 << 20 ) {
 		if( streamPos > (needed >> 1) && needed > 16 << 20 ) {
 			needed -= streamPos;
 			needed -= streamPos;
@@ -538,7 +538,7 @@ class GlDriver extends Driver {
 			if( needed < streamLen )
 			if( needed < streamLen )
 				return;
 				return;
 		}
 		}
-		
+
 		var newLen = streamLen == 0 ? 0x10000 : streamLen;
 		var newLen = streamLen == 0 ? 0x10000 : streamLen;
 		while( newLen < needed )
 		while( newLen < needed )
 			newLen = (newLen * 3) >> 1;
 			newLen = (newLen * 3) >> 1;
@@ -546,17 +546,17 @@ class GlDriver extends Driver {
 		if( streamPos > 0 )
 		if( streamPos > 0 )
 			newBytes.blit(0, streamBytes, 0, streamPos);
 			newBytes.blit(0, streamBytes, 0, streamPos);
 		streamLen = newLen;
 		streamLen = newLen;
-		streamBytes = newBytes;		
+		streamBytes = newBytes;
 	}
 	}
-	
+
 	#end
 	#end
-	
+
 	function resetStream() {
 	function resetStream() {
 		#if hl
 		#if hl
 		streamPos = 0;
 		streamPos = 0;
-		#end		
+		#end
 	}
 	}
-	
+
 	inline function streamData(data, pos:Int, length:Int) {
 	inline function streamData(data, pos:Int, length:Int) {
 		#if hl
 		#if hl
 		var needed = streamPos + length;
 		var needed = streamPos + length;