Skip to content

multiple sketches in instance mode on one page doesn't work with webgl #998

@lmccart

Description

@lmccart

sample code for testing

var s = function(p) {
  p.setup = function() {
    p.createCanvas(200, 200, p.WEBGL);
    p.background(0);
  }
}

new p5(s);

var s2 = function(p) {
  p.setup = function() {
    p.createCanvas(200, 200, p.WEBGL);
    p.background(200);
  }
}

new p5(s2);

I think this could be part of the problem:
https://github.com/processing/p5.js/blob/master/src/core/rendering.js#L55

I'm currently looking into auto-incrementing the id per instance, related to this issue: #965

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions