I am struggling to choose an appropriate default value to assign for my buffers and so on. For example, I might have a class that has vertex array (unsigned int), what value should I assign by default before it is initialised? 0/-1? Later on I do use these values to check this/these values for sanity checks before using them.
Looking at my last and current project I am mostly using 0 but I see a few -1s popping up. Obviously that's not good. Is the first value that the 'Gen' functions will return 1? That seems to be the case as logically if they did return 0 I would notice the effects from that. -1 (unsigned int wrap around) just seems like a value that works purely based on the fact that it ends up being a very large integer that I am probably unlikely to ever have returned from one of these functions.
So what is the 'correct' value I should be using as default values before calling any of these functions:
glGenTextures
glGenBuffers
glGenFramebuffers
glGenVertexArrays
I realise I could also use glGetError for validation after calling the functions but I still need a default value and I am now confused what to use.
I checked some of the references e.g.
https://www.opengl.org/sdk/docs/man/html/glGenTextures.xhtml
and it doesn't really mention a range for the values returned.
Experimentally I am finding that the first value I get is 1 so 0 seems like the best choice, can anyone confirm this?
The reason I have gotten confused is glGetUniformLocation as a location of 0 is perfectly valid. What is a good default for that, -1?
Thanks.