Browse Source

added getContext3d() shortcut

Nicolas Cannasse 12 years ago
parent
commit
b0ba49bb08
1 changed files with 4 additions and 0 deletions
  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"); }
+
 }