Selaa lähdekoodia

added getContext3d() shortcut

Nicolas Cannasse 12 vuotta sitten
vanhempi
commit
b0ba49bb08
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  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"); }
+
 }