fltk.gl

FLTK High-Level OpenGL API

This package provides idiomatic D wrappers for FLTK OpenGL support. It offers RAII-based GL window management with scoped context activation.

Features:

  • GlWindow: OpenGL-capable window with RAII resource management
  • GlScope: Scoped context activation for safe GL calls
  • Mode flags for configuring double buffering, depth buffer, etc.

Example:

import fltk.gl;

void main() {
   if (!hasGlSupport()) {
      writeln("OpenGL not available");
      return;
   }

   auto win = new GlWindow(640, 480, "OpenGL Demo");
   win.mode = Mode.DOUBLE | Mode.DEPTH;
   win.show();

   // Render loop
   while (win.shown()) {
      auto ctx = win.activate();
      // OpenGL calls here
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      // ... render scene ...
      win.swapBuffers();
      Fl.wait();
   }
}

Authors

Dejan Lekić

License

BSD-3-Clause
No exported symbols.