Quote:Why not something like
lib::Enable<GL_DEPTH_TEST>();
Yeah, that works. But it's no better solution to the 'problem' of having different appearance to other functions. I would as well use what I currently have, that is simple enumerators as described above.
Quote:Why can't you just use the actual enum values?
I didn't mention that in the first post, but that is what I had at first. Now what I tried, for aesthetic reasons, was to unify the function signature styles. Fex. I have a function StencilFunc(GLenum, GLint, GLuint) that sets OpenGL Stencil Function states. Because these accept enums like GL_LEQUAL, I thought there was inconsistency here so I tried to fix it.
I handle OpenGL enable states like GL_DEPTH_TEST, GL_LIGHTING all in one set of functions and the ones like glStencilFunc each in their own set of functions. So I could either change the enable states to support directly GL_* or change functionstates to support my own enumerators... I figured it might be easier to do the first.
Quote:Quote:I could give up and just throw error at runtime, but that feels somehow wrong.Why?
Well I do have already compile time assurance for correct values with the enums (well at least almost, as above posters have mentioned) so having to resort to run time checks feels like a step back :)
But even so, I have decided to accept that step and did change the code to use GLenums only, and letting errors go unnoticed until run time.