This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var loseCtx = context.gl.getExtension("WEBGL_lose_context"); | |
| //May not exist in some browsers, or if WebGLInspector is enabled | |
| if (loseCtx) { | |
| //Attach a mouse click to the canvas... | |
| canvas.addEventListener("mousedown", function() { | |
| //Force the canvas to lose its WebGL context | |
| loseCtx.loseContext(); | |
| //Here you may want to present the user with a progress indicator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import haxe.macro.Expr; | |
| import haxe.macro.Context; | |
| class ClassicSwitch | |
| { | |
| macro static public function from(inExpr:Expr):Expr | |
| { | |
| var retExpr:Expr = null; | |
| switch (inExpr.expr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Main { | |
| static function main() { | |
| MyMacro.testReify(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| namespace UnityEngine { | |
| /// <summary> | |
| /// Usage: | |
| /// | |
| /// (optional) Call GUIScaler.Initialize() in Start(), Awake() or OnEnable() (only needed once) | |
| /// Call GUIScaler.Begin() at the top of your OnGUI() methods | |
| /// Call GUIScaler.End() at the bottom of your OnGUI() methods |
NewerOlder