[HOpenGL] OpenGLRaw naming convention

Jason Dagit dagitj at gmail.com
Mon Jan 16 20:55:27 CET 2012


On Mon, Jan 16, 2012 at 3:19 AM, L Corbijn <aspergesoepje at gmail.com> wrote:
> Hello HOpenGL,
>
> While working on my OpenGLRaw-generator which is getting quite good
> (current OpenGL compiles with minor changes) I've come to wonder/worry
> about the current naming convention of Raw.
>
> The current naming scheme of OpenGLRaw can best be described as, try
> to remove the vendor names (NV, ARB, etc. suffixes) unless it will
> result in a conflict. To give two examples, MultiTexCoord2dARB ->
> MultiTexCoord2d, as there is none defined otherwise, while
> glPrimitiveRestartIndexNV keeps it's name as glPrimitiveRestartIndex
> is a different function.
>
> When generating code I've come across a few nasty disadvantages with
> no obvious solution in this scheme.
> 1. What to do when two or more vendors have the same enum/function
> which should be promoted to the one without vendor name.
> 2. The mixing of functions with and without vendor name, e.g.
> glPrimitiveRestart, glPrimitiveRestartIndexNV from NVidia's
> PrimitiveRestart extension.
> 3. Breaking changes, what if a new extension or even a new OpenGL
> version adds a different enum/function with the same name (without
> vender part), as the striped name collides the extension must be
> re-added leading to some code breaking (maybe even silently!).
> The only advantage I see is that two enums/functions who differ in
> name also differ in value/implementation.
>
> Therefore I would like to know what people think about the current
> naming convention, and whether it would be a major issue to change it
> (probably to keeping the vendor names everywhere).

Two ideas:
  * What about having the "RAW" api keep the names verbatim and other
layers on top rename things?  Basically, defer this decision to a
different point.
  * Collect all the Foo versions in a Foo module and then remove the
Foo from the names inside the module.

Does that make sense?  Are either of these possible with your bindings
generator?

I don't mind if the names have NV or ARB in them, but I may represent
a minority opinion.

Jason



More information about the HOpenGL mailing list