Class GLWrapper

java.lang.Object
org.boxutil.define.GLWrapper

public final class GLWrapper extends Object
This wrapper automatically adapts commonly used OpenGL functions by querying driver and hardware support for specific features. Functions are organized by functionality or OpenGL object type rather than by OpenGL version. All calls are statically linked via method references, incurring no runtime branch overhead.

The adaptation priority follows: OpenGL Core > ARB Extension > EXT Extension > Other Extensions.

Before using this wrapper, you must call BoxUtilModPlugin.initPre() in your mod's initialization method. Subsequently, before invoking actual OpenGL functions through GLWrapper, you must check availability via valid() or valid_XXX() for the corresponding feature, to decide whether to fall back or abort. Failing to do so will result in an NPE if the required feature is not supported.

For OpenGL enumerants, GLWrapper stores them as static non‑final fields. They should be read only; set new values to these fields is forbidden.

Excluded: parts of OpenGL 1.1 / OpenGL 1.2 (for example: Immediate mode, Client array, Display list).

  • Method Details

    • init

      public static void init()