PDA

View Full Version : Do glGet__() functions always modify their argument even on error?



ffhighwind
04-15-2013, 08:11 PM
Do glGet___() functions always modify the output variable, even on errors?

Examples:
glGetVertexAttrib, glGetInteger, glGetProgram, glGetVertexAttrib, glGetBufferParameter, etc.

Yes, this is an extremely minor optimization that is fairly unsafe and probably shouldn't be done. Since this question is implementation dependent, I'm looking at OpenGL 3.x and 4.x.

Alfonse Reinheart
04-15-2013, 09:28 PM
Yes, this is an extremely minor optimization that is fairly unsafe and probably shouldn't be done.

... What is a "minor optimization"? What are you "optimizing"? And most important of all, if even you believe that it "probably shouldn't be done"... why are you doing it? Whatever it is that you're doing.


Since this question is implementation dependent

You asked a question that you already knew the answer to (though technically, the answer is that it is undefined in most cases, not implementation dependent). So... what exactly do you want to know? The answer is what you said: there is no answer.

ffhighwind
04-17-2013, 01:17 AM
Answered my own question:

glGetQueryObject

If an error is generated, no change is made to the contents of params.

Alfonse Reinheart
04-17-2013, 08:14 AM
... how does that answer your question? That answers it for one function, but not for all of the ones you asked about.