Browse Source

more generic "render" shortcut

Nicolas Cannasse 13 năm trước cách đây
mục cha
commit
69b46d4e36
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      h3d/Engine.hx

+ 2 - 3
h3d/Engine.hx

@@ -261,10 +261,9 @@ class Engine {
 		curTextures = [];
 	}
 	
-	public function render( objects : Array<Object> ) {
+	public function render( obj : { function render( engine : Engine ) : Void; } ) {
 		if( !begin() ) return false;
-		for( o in objects )
-			o.render(this);
+		obj.render(this);
 		end();
 		return true;
 	}