소스 검색

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

ncannasse 11 년 전
부모
커밋
6d9a514d8c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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();