Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple contexts on the same page #9

Open
dheera opened this issue Jul 18, 2021 · 1 comment
Open

Multiple contexts on the same page #9

dheera opened this issue Jul 18, 2021 · 1 comment

Comments

@dheera
Copy link

dheera commented Jul 18, 2021

Is there a good example illustrating multiple contexts on the same page? I'm getting WebGL: INVALID_OPERATION: bindBuffer: object does not belong to this context and not quite sure where to start.

@dheera
Copy link
Author

dheera commented Jul 19, 2021

Dug through the code and found the (undocumented) solution.
Instead of doing e.g.

    this.gl = GL.Create( ... )
    ...
    this.yourMesh = GL.Mesh.load({vertices: this.yourPoints, colors: this.yourColors});

You need to do

    this.gl = GL.Create( ... )
    ...
    this.yourMesh = GL.Mesh.load({vertices: this.yourPoints, colors: this.yourColors}, null, null, this.gl);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant