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

creating multiple games and deleting them #1260

Closed
hankeypancake opened this issue Oct 27, 2014 · 5 comments
Closed

creating multiple games and deleting them #1260

hankeypancake opened this issue Oct 27, 2014 · 5 comments

Comments

@hankeypancake
Copy link

Hi. I probably use phaser in a way it's not meant to be used, but since the 2.1.3 release I've been getting an issue where if I dynamically create more than 4 games, they only render as totally black when I use WebGL. If I use the canvas renderer everything is fine.

here's a (shitty) codepen to illustrate the issue:
http://codepen.io/hankeypancake/pen/oHgxb

Am I not destroying the games properly or is this a totally wrong way of doing this?

Chrome console tells me:
'WARNING: Too many active WebGL contexts. Oldest context will be lost.'

@photonstorm
Copy link
Collaborator

Hmmm I've done some further digging into this and even calling the Pixi renderer destroy methods in a local build, but it still happens, so I'm suspecting the Pixi destroy doesn't actually work. I'll need to confirm in a Pixi specific build and file as an issue there if true.

@photonstorm
Copy link
Collaborator

I'm putting this down as a bug for now, because it definitely happens in my local test case, but I'm still convinced it's a Pixi level bug. Need more time to investigate.

@hankeypancake
Copy link
Author

sure! I'm pretty sure it worked before bumping to 2.1.3. Thanks for the quick response (:

@photonstorm
Copy link
Collaborator

It did, but Pixi changed massively in 2.1.3

photonstorm added a commit that referenced this issue Feb 11, 2015
…Id` and remove it from the PIXI.instances global. `Game.destroy` now hooks into this. This now means that you can now delete and create your Phaser game over and over without it crashing WebGL after the 4th attempt (#1260)
@photonstorm
Copy link
Collaborator

Thanks for your test case, it really helped me isolate and fix this!

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

2 participants