The engine already calls getContext on the canvas, and you cannot call it again. Within the scope of the SDK, you should only draw using the canvas 2D context passed to you in the draw() function, and you must also provide a drawGL() function for the WebGL renderer.