Explorar o código

added setTarget to make sure shader is reset when doing 2d multipass

ncannasse %!s(int64=11) %!d(string=hai) anos
pai
achega
6d9a514d8c
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      h2d/RenderContext.hx

+ 6 - 0
h2d/RenderContext.hx

@@ -61,6 +61,12 @@ class RenderContext {
 		currentObj = null;
 	}
 
+	public function setTarget( t : h3d.mat.Texture ) {
+		flush();
+		engine.setTarget(t);
+		begin();
+	}
+
 	public function flush() {
 		if( bufPos == 0 ) return;
 		beforeDraw();