[HOpenGL] API names [was: ghc-6.0.1 and OpenGL enabled]

Sven Panne Sven.Panne at informatik.uni-muenchen.de
Thu Oct 9 18:02:03 EDT 2003


Thanks for all your replies, naming is obviously still one of the hottest
topics in CS...     Here are my thoughts: "locally" is (as already
mentioned) too general, and "withFoo" is traditionally used for functions
with a signature of the form:

    withFoo :: Foo -> ...

But the current matrix is implicit, so this would not be a good choice for
the combination of glPushMatrix/glPopMatrix. We are basically left with:

    saveFoo          might not give a hint that a Foo is restored
    rememberingFoo   same comment as above applies
    preservingFoo    sounds good to me, but might be a bit long

The current story for the combined GL calls is:

    glBegin/glEnd                          renderPrimitive
    glNewList/glEndList                    defineList
    glPushName/glPopName                   pushName
    glPushMatrix/glPopMatrix               matrixExcursion
    glPushAttrib/glPopAttrib               saveServerState
    glPushClientAttrib/glPopClientAttrib   saveClientState

The first two sound right to me, the third is actually a "withFoo", and
the last three should be named in a consistent way. Combining your proposals
I suggest:

    glBegin/glEnd                          renderPrimitive
    glNewList/glEndList                    defineList
    glPushName/glPopName                   withName
    glPushMatrix/glPopMatrix               preservingMatrix
    glPushAttrib/glPopAttrib               preservingAttrib
    glPushClientAttrib/glPopClientAttrib   preservingClientAttrib

Does this sound OK, especially for the native speakers on this list?

Cheers,
    S.




More information about the HOpenGL mailing list