Example #1
0
 protected WebGL2RenderingContextBase(
     JSObject canvas,
     string contextType,
     WebGLContextAttributes contextAttributes,
     string windowPropertyName = WindowPropertyName)
     : base(canvas, contextType, contextAttributes, windowPropertyName)
 {
 }
Example #2
0
        protected WebGLRenderingContextBase(
            JSObject canvas,
            string contextType,
            WebGLContextAttributes contextAttributes,
            string windowPropertyName = WindowPropertyName)
        {
            if (!CheckWindowPropertyExists(windowPropertyName))
            {
                throw new PlatformNotSupportedException(
                          $"The context '{contextType}' is not supported in this browser");
            }

            gl = (JSObject)canvas.Invoke("getContext", contextType, contextAttributes?.Handle);
        }
Example #3
0
 public WebGLRenderingContext(JSObject canvas, WebGLContextAttributes contextAttributes)
     : base(canvas, "webgl", contextAttributes)
 {
 }