I’m using the JSR-231 code and vertex buffer objects in rendering. When I resize the window they become invalid and I must re-initialise them.
I’ve been looking at how to do this efficiently. A call to gl.glGetBufferParameterivARB(…) takes about 28 micro seconds (using System.nanoTime()) but I wish to reduce that. If I understand it right, with JSR-231 jogl the GL context will remain valid across all calls to the display function, although all work will get executed on one thread. I have seen where the drawable.getGL() is the same across multiple display calls, but it changes after resizing.
My question is, can I reliably (supporting best practices) hold on to the GL context from within the init function, and use this in my display method (ignoring the drawable.getGL()), and then check to see if this is different, to know when to re-initialise my vertex buffer objects