WW.GL 3.5 Features

  • Support for OpenGL 1.1
  • Wrapper classes for rendering context, display lists
  • Delegate definitions for tessellation callbacks (example code provided)

Design philosophy

WW.GL was designed with the following two purposes in mind:

  • WW.GL should be as thin as a wrapper could be for best performance. Careful attention was paid to only do the minimal marshaling required. If an array goes into OpenGL, it does not need to be marshaled back out of OpenGL. Further no attempt is done to force any object oriented wrapper model upon the user except in those few cases where it makes sense. First: objects have their performance penalty, and second: the user should have the freedom to design their own object model the way they want it.

    There are a few cases where the performance argument is of minor importance with respect to ease of use. That is why a few objects exist in WW.GL: like class RenderingContext, a convenient wrapper around a OpenGL rendering context and a Windows device context. This is typically a long-lived object, with not a huge amount of calls to it, so here a wrapper object has added value. Furthermore this object implements the IDispose interface, so cleanup is convenient too. Nevertheless use of RenderingContext is not enforced, and one still has access to the lower level methods.
  • WW.GL should make using OpenGL as easy as possible by providing maximum type safety. A good example of the innovative way of thinking here are the P-Invoke method overloads used for the glEnable call:

    public static extern void Enable(Capability cap);
    public static extern void Enable(LightName cap);
    public static extern void Enable(ClipPlaneName cap);
    public static extern void Enable(MapTarget cap);
    public static extern void Enable(PolygonOffset cap);

    Other OpenGL wrappers just use a single class containing a huge list of constants, not leveraging the power of the compiler, autocompletion and intellisense! Wout Ware has put some serious thought and time in making WW.GL easy to use and has grouped all constants into enums. So whenever you're typing an OpenGL method name, autocompletion will suggest to you which enums are appropriate for that method call! WW.GL gives you all the benefits of compile time error checking, autocompletion and intellisense.