Login  Register

Re: Drawing more than a certain number of triangles at one time/method/stack crash

Posted by gouessej on Dec 17, 2015; 11:50am
URL: https://forum.jogamp.org/Drawing-more-than-a-certain-number-of-triangles-at-one-time-method-stack-crash-tp4035900p4035911.html

You're welcome.

You shouldn't pass GL instances, this is a bad practice, it might lead you to use an invalidated instance. I advise you to look at the renderers of the most famous 3D engines (JMonkeyEngine, LibGDX, JogAmp's Ardor3D Continuation, ...), I call GLContext.getCurrentGL() instead of passing GL instances. If you called getCurrentGL() on the wrong thread or at the wrong time, it would throw an exception with an understandable error message instead of causing a crash.
Julien Gouesse | Personal blog | Website