microsoft / Chakra-Samples

Repository for Chakra JavaScript engine related samples.
MIT License
216 stars 84 forks source link

What are missing to get JsBridge support WebGl? #40

Closed JimSEOW closed 8 years ago

JimSEOW commented 8 years ago

https://github.com/deltakosh/JsBridge/issues/16

var ctx = document.createElement('canvas').getContext('experimental-webgl');

What needs to be done to make that works? There is no WebGLRenderingContext.cs How to create WebGLRenderingContext.cs that links to the OpenGL example here?

    `public object getContext(string contextType)
    {
        if (contextType == "2d") {
            if (this.context == null) {
                this.context = new CanvasRenderingContext2D(this.window, this);
            }
            return this.context;
        }
       else if (contextType == "experimental-webgl" || contextType == "webgl")
        {
            if (this.context == null)
            {
                this.context = new WebGLRenderingContext(this.window, this);
            }
            return this.context;
        }
        return null;
    }`
liminzhu commented 8 years ago

DOM and canvas are really out of the scope of JavaScript and Chakra/ChakraCore. https://github.com/deltakosh/JsBridge/issues/16 would be a better place for this discussion.