瀏覽代碼

added getContext3d() shortcut

Nicolas Cannasse 12 年之前
父節點
當前提交
b0ba49bb08
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      std/js/html/CanvasElement.hx

+ 4 - 0
std/js/html/CanvasElement.hx

@@ -47,4 +47,8 @@ extern class CanvasElement extends Element
 
     /** A typed shortcut for <code>getContext("2d")</code>. */
     public inline function getContext2d () :CanvasRenderingContext2D { return cast getContext("2d"); }
+	
+    /** A typed shortcut for <code>getContext("webgl")</code>. */
+    public inline function getContext3d () : js.html.webgl.RenderingContext { return cast getContext("webgl"); }
+
 }