Ver Fonte

hlsdl MRT support

Nicolas Cannasse há 9 anos atrás
pai
commit
3b10231eda
1 ficheiros alterados com 8 adições e 0 exclusões
  1. 8 0
      h3d/impl/GlDriver.hx

+ 8 - 0
h3d/impl/GlDriver.hx

@@ -728,6 +728,8 @@ class GlDriver extends Driver {
 			#if js
 			#if js
 			if( mrtExt != null )
 			if( mrtExt != null )
 				mrtExt.drawBuffersWEBGL([GL.COLOR_ATTACHMENT0]);
 				mrtExt.drawBuffersWEBGL([GL.COLOR_ATTACHMENT0]);
+			#elseif hlsdl
+			gl.drawBuffers(1, @:privateAccess CBUFFERS.bytes);
 			#end
 			#end
 		}
 		}
 	}
 	}
@@ -769,6 +771,8 @@ class GlDriver extends Driver {
 		#if js
 		#if js
 		if( mrtExt != null )
 		if( mrtExt != null )
 			mrtExt.drawBuffersWEBGL([for( i in 0...textures.length ) GL.COLOR_ATTACHMENT0 + i]);
 			mrtExt.drawBuffersWEBGL([for( i in 0...textures.length ) GL.COLOR_ATTACHMENT0 + i]);
+		#elseif hlsdl
+			gl.drawBuffers(textures.length, @:privateAccess CBUFFERS.bytes);
 		#end
 		#end
 	}
 	}
 
 
@@ -874,6 +878,10 @@ class GlDriver extends Driver {
 		GL.FUNC_REVERSE_SUBTRACT
 		GL.FUNC_REVERSE_SUBTRACT
 	];
 	];
 
 
+	#if hlsdl
+	static var CBUFFERS = (cast [for( i in 0...32 ) GL.COLOR_ATTACHMENT0 + i] : hl.types.ArrayBase.ArrayBasic<Int>);
+	#end
+
 }
 }
 
 
 #end
 #end