Jump to content

Render Warning on WebGL prevents game from displaying


elleniaw
 Share

Recommended Posts

When I re-initialise my game for the 5th time (and weirdly always the 5th time) I get the following error in WebGL render-mode: "RENDER WARNING: there is no texture bound to the unit 0"

In Canvas render mode I don't get the error and can re-initialise my game as many times as I want. With re-initialising I mean overwriting/instantiating a new phaser.Game on the same variable.

To create: click on the canvas a couple of times here while having the console open: http://jsfiddle.net/cb8vhas3/ To 

 

 

 

Link to comment
Share on other sites

Why would you create 5 different games? You don't even delete the previous ones, it's obvious that the GPU can't render so many scenes at once.

You don't "re-intialize" the game, you create new games, and all of them keep running. See this, look at the console: http://jsfiddle.net/cb8vhas3/1/ (you can see that all games keep running)

Link to comment
Share on other sites

Thanks for the reply.

I was under the assumption that when I overwrite the reference to the game, there is no reference to the previous one and GC will pick it up. Why I want to do it this way is because I want the same game with different content coming from a server without reloading the page. How then do I delete the previous ones? and re-initialize the canvas with a new one?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...