[Mesa-dev] rationale for GLubyte pointers for strings?
baggett.patrick at gmail.com
Tue Jul 19 12:26:48 PDT 2011
SGI invented OpenGL and offered it first on their IRIX platform. SGI's
MIPSpro compiler has the "char" datatype as unsigned by default, so the
compiler would likely complain if assigning a GLbyte pointer to an
[unsigned] character pointer. Thus, to do something like
char* ext = glGetString(GL_VENDOR);
doesn't require a cast on IRIX, while the same code would require a cast
using other compilers due to the aforementioned problem.
On Tue, Jul 19, 2011 at 1:44 PM, Allen Akin <akin at arden.org> wrote:
> On Tue, Jul 19, 2011 at 12:20:54PM -0600, tom fogal wrote:
> | glGetString and gluErrorString, plus maybe some other functions, return
> | GLubyte pointers instead of simply character pointers...
> | What's the rationale here?
> I agree, it's odd. I don't remember the rationale, but my best guess is
> that it papered over some compatibility issue with another language
> binding (probably Fortran). I suppose there's a very slight possibility
> that it sprang from a compatibility issue with Cray.
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mesa-dev