Skip to content

OpenGL Guide

squid233 edited this page Jan 7, 2025 · 1 revision

Functions

The OpenGL module does not use static but instance methods to invoke functions. An instance is required to be constructed before the methods could be invoked.

To obtain such instance, simply use new.

void main() {
    var gl = new GL(GLFW::glfwGetProcAddress);
}

Common overloads

OverrunGL provides single parameter/return overloads for glGen*, glCreate* and glDelete* functions. For glGen* and glCreate*, there is no parameter and a return value. For glDelete*, there is a parameter accepting an OpenGL object to be deleted.

void glGen/glCreate*(int n, @Out MemorySegment dst) -> int glGen/glCreate*()
void glDelete*(int n, MemorySegment objs) -> void glDelete*(int obj)
Clone this wiki locally