Re: Curve text rendering and glBindVertexArray(0)
Posted by Amit Shesh on Sep 20, 2017; 3:09pm
URL: https://forum.jogamp.org/Curve-text-rendering-and-glBindVertexArray-0-tp4038188p4038193.html
OK, more information.
I tried to print all the vertex array objects currently in use at various points of my program:
Here is what I had right after the GLEventListener's init is called (before I do anything OpenGL-related):
VAO 1 is being used before any initialization!
VAO 2 is not being used before any initialization!
VAO 3 is not being used before any initialization!
VAO 4 is not being used before any initialization!
VAO 5 is not being used before any initialization!
VAO 6 is not being used before any initialization!
VAO 7 is not being used before any initialization!
VAO 8 is not being used before any initialization!
VAO 9 is not being used before any initialization!
VAO 10 is not being used before any initialization!
Curiously it shows that VAO id 1 is being used. I have no idea for what, but I assume this is some JOGL stuff.
Here is what I had after I do all the initialization of my code, but not the curve text renderer:
VAO 1 is being used after view initialization!
VAO 2 is being used after view initialization!
VAO 3 is not being used after view initialization!
VAO 4 is not being used after view initialization!
VAO 5 is not being used after view initialization!
VAO 6 is not being used after view initialization!
VAO 7 is not being used after view initialization!
VAO 8 is not being used after view initialization!
VAO 9 is not being used after view initialization!
VAO 10 is not being used after view initialization!
It shows that VAO 2 is now being used. I confirmed that this is used in my code, as it is using only one VAO.
Finally here is what I had after I initialized stuff for the curve text renderer (TextRegionUtil and RegionRenderer):
VAO 1 is being used after text renderer initialization!
VAO 2 is being used after text renderer initialization!
VAO 3 is not being used after text renderer initialization!
VAO 4 is not being used after text renderer initialization!
VAO 5 is not being used after text renderer initialization!
VAO 6 is not being used after text renderer initialization!
VAO 7 is not being used after text renderer initialization!
VAO 8 is not being used after text renderer initialization!
VAO 9 is not being used after text renderer initialization!
VAO 10 is not being used after text renderer initialization!
---
This last step shows that the curve renderer did not request any new VAOs. Thus, I suspect that the curve renderer code is using vertex buffer objects without using a vertex array object. This seems to make sense because when I say glBindVertexArray(1) instead of glBindVertexArray(0), it seems to work because it finds a valid VAO bound to the context.
As I understand it, using VBO without VAO is not allowed in the OpenGL core profiles. Mac OS X does not support OpenGL compatibility profiles, which may be why this error shows up only on a Mac but not windows.
Does this provide you any insight as to what may be going wrong?