OpenGL++ (OpenGLPlus) Possible Layers

Layers

This section describes what I believe to be the possible layers that could make up an OGL++, starting with simple OpenGL wrappers and proceeding up to Inventor-like functionality.

OpenGL

  • Standard OpenGL API.
  • Immediate mode.
  • Display lists.
  • Does not impose a scene-graph model on the user.

Wrapped OpenGL

  • Object interface for context.
  • Select objects into context (objects are vertex/normal/tex/color arrays, texture objects, light objects).
  • Display lists are objects returned by context and are hierarchical.
  • Get/Set attributes of context.
  • Context extensions through inheritance, run-time binding possible.
  • Run-time typing.
  • Does not impose a scene-graph model on the user.

"Super-wrapped" OpenGL

Same as Wrapped OpenGL, but:

  • Display lists are internal, protected.
  • Objects selected into the context are assigned and associated with a handle by the context that represents any pertinent information about the object that may be reused to accelerate rendering that object the next time it is selected into that context. This could be as simple as the handle to a display list, or a more complex internal structure.
  • Does not impose a scene-graph model on the user.
  • Possible distributed model with CORBA/COM.
  • Possible stacked architecture similar to Heidi.

Retained OpenGL

  • Scene graph.
  • Traversal.
  • Context extensions through inheritance, run-time binding possible.
  • Run-time typing.
  • Possible distributed model with CORBA/COM.

Inventor-like OpenGL

Same as Retained OpenGL, but:

  • Complex interdependencies with fields, engines, sensors, etc.

My Recommendations for OpenGL++

  1. Cooperate with the Object Management Group (OMG), provide a common, open, distributed interface for OpenGL++. Distributed object standards like CORBA force good object-oriented design practices on interfaces that would otherwise fall prey to structured, procedural, or abstract data type designs.
  2. A general-purpose, retained-mode API would be difficult to design from scratch, and (short of using an existing interface like Inventor) would be difficult to design properly for a wide variety of applications. Instead, provide resources to retained-mode programs that define a minimum set of retained-mode functionality, enough to allow accelerated performance and flexibility. My "Super-wrapped" OpenGL suggests that OpenGL++ could associate an internal data structure with an object instantiation, which may be enough "retained-mode" information to allow performance improvements.

Copyright © 2004 Eric Powers.  All rights reserved.