views:

60

answers:

1

I have 2 separate renderers, one for 1.1 and another for 2.2

I have a bunch of Items which hold image information and the texture handle generated by whichever renderer I am using.

Items are just dumb objects and I don't want to introduce any OpenGL specific functionality into them. The problem is, I need to store their texture handle somewhere. I would like to store it inside each Item, however a handle is of type GLuint.

If I use a GLuint it means including either the gl.h from ES1/ or from ES2/. Now they are both typedef'd as unsigned ints... is it OK to just use an unsigned int? It seems like bad practice... For example if OpenGL 3.0 came out and a GLuint was something completely different, Item would be broken.

Any ideas?

Thanks for reading.

+1  A: 

Subsequent versions of OpenGL are supersets of their previous versions. The OpenGL specific types are meant to hide the underlying systems but be consistent across versions. For example if you have int as a 16 bit then GLuint might be defined as unsigned long.

Therefore I would say: Go with the smallest common denominator (ES1.1).

Stefan Schmidt
Thank you for a concise and helpful answer
Sam
OpenGL ES 2.0 is not a simple superset of OpenGL ES 1.1 - because it's more programmable it requires more set up to get the default 1.1 behaviour.
andrewmu