suggestion: refining functions

i was wondering if its ever a possibility that opengl functions take unsigned ints rather than ints for various parameters such as dimension values. a horizontal or vertical dimension will never be negative so i set up my code to make sure all dimension or (size_t) values are of unsigned int. id rather not type cast (to remove warnings) when passing my values in. anyway around this? perhaps overloading these functions?

thankyou,
paulm.

Yeah I don’t know why they use int instead of uint as you say, the dimension values can’t be negative. But this is the way it was done and I doubt it will change. The largest positive number you can store in an int is pretty darn big and I doubt we’ll need anything bigger for dimensions any time soon. I guess what you could do is make wrappers for the GL calls that pass the types you would rather use and the wrapper will do the casting so you won’t have to worry about it later. It would be easier to just go back and make your structures ints instead. You’re not going to need the extra range the unsigned type gives anyway.

-SirKnight

Just write a wrapper around the functions that bug you or just do the casts. (just a small (GLsizei) which is a no-op)

You could also just change your header (gl/gl.h) file to replace these GLsizei with GLuint. Most platforms it would work, but not something I would recommend.

There is no way you are going to get the ARB to change the spec.

(keep in mind that the ARB usually create entry points to accomodate new and unknown future extensions, so in the future perhaps some new texture type or setup state could take negative values)

[Edit]
Drat! beaten again…

>>Just write a wrapper around the functions that bug you or just do the casts. (just a small(GLsizei) which is a no-op)
will do. makes sense.

>>(keep in mind that the ARB usually create entry points to accomodate new and unknown future extensions, so in the future perhaps some new texture type or setup state could take negative values)
very true, i agree. -1 invalid texture, etc

thanks all,
paulm.

forgot to state…

>>The largest positive number you can store in an int is pretty darn big and I doubt we’ll need anything bigger for dimensions any time soon.
>>You’re not going to need the extra range the unsigned type gives anyway.
>>-SirKnight

agreed. i realize this i just like the idea of using a variable that enforces its sign.

thanks,
paulm.