When the init method is called can I store the gl object I get there and use that everywhere else or do I have to call this
gl = drawable.getGL().getGL2();
every single time, and why?
About the state of OpenGL,
how costly are things like glLineWidth, glColor, glBlendMode, glEnable/Disable?
Would it be worth it to create a class to manage the state of OpenGL eg.
instead of:
glLineWidth(2);
Something like:
StateManagementClass.glLineWidth(float width){
if(currentLineWidth != width){
currentLineWidth = width;
glLineWidth(currentLineWidth)
}
}
With similar methods for enabling/disabling texture, blend mode, color etc.