On Sat, Feb 12, 2000 at 12:42:02PM -0800, Bernd Kreimeier wrote:
> I have one borderline [sic] ABI issue left. With portability
> and backwards compatibility in mind, it's more of an inquiry.
>
> GLenum (at least the Mesa version) maps multiple enum names
> to the same value, e.g.
>
> GL_TEXTURE_INTERNAL_FORMAT, GL_TEXTURE_COMPONENTS
> GL_TRUE, GL_NONE, GL_ONE
> GL_FALSE, GL_ZERO,
> GL_LOGIC_OP, GL_INDEX_LOGIC_OP
>
> It's a bit of a nuisance for the GLTrace-like composable
> QGL pipeline I am working on (spits out valid GL code
> where possible, for convenient posting and testing).
>
> Is there a good reason for this duplication. Just accidents
> now protected by virtue of legacy?

    Well, it's fairly obvious why we want e.g. GL_ZERO and GL_FALSE to
have the same value, but mostly I'd say there was a lack of foresight in
some cases. Take texture internal formats - in OpenGL 1.0 there were
only 4, named '1' through '4'. Later on named enums were used, but we
still have to support the old numeric formats too. I'm sure Allen or
David can offer more perspective on this.

    Also, not every named value is purely an abstract identifier. Some
things are bitmasks, some are indices, etc. Just as a side mention, it
would be really hard to change the assigned enum values even in a
hypothetical OpenGL 2.0 , since some hardware actually encodes the values
physically!

    Jon Leech
    SGI

Reply via email to