few bags(or not)

1. SceneObject.toGrid();

cause infinite stack error, when add in editor 

Uncaught RangeError: Maximum call stack size exceeded

to object in functions as example in onAddToScene   (because cloning with this function)

cloning with toGrid() must mean it

2. http://clockworkchilli.com/snippets

all snippets with wade.draw functions are not working properly  - because default render mode is webgl





i wrote about it that sometimes i see verbose in console

[.Offscreen-For-WebGL-00000077FB6B0E10]GL ERROR :GL_INVALID_ENUM : GetIntegerv: <- error from previous GL command

because WADE creating webgl canvas before than render mode set in user app()


1 Comment


1. It doesn't matter whether it's in the editor or not. If you have an onAddToSceneFunction that does this


or even just an onAddToScene function that creates a clone and adds it to the scene, then it's not going to work. This is because each cloned object will have the same onAddToScene function and will do the same thing when added to the scene, so you get into an infinite loop.

The right way to do it (if you want to do it in onAddToScene) is:

this.onAddToScene = null;

2. That's true, thanks for letting us know. I hadn't noticed that, I'll fix the snippets now.

To clarify, WADE creates a canvas (by default a webgl canvas) when it needs to draw something into it. If you change a layer render mode to 2d before you draw anything to it (for example in App.init), there shouldn't be any problems. 

I will have a look at that error though, it may be something else.

Post a reply
Add Attachment
Submit Reply
Login to Reply