Skip to content

API Reference / @gtkx/gl

@gtkx/gl ​

OpenGL 4.6 core bindings generated from the Khronos registry. Each command and constant maps to the C one of the same name, so the Khronos OpenGL 4.6 reference documents its parameters and behavior.

Names and types ​

  • Commands drop the gl prefix and start in lowercase: gl.clear calls glClear.
  • Constants drop GL_: gl.COLOR_BUFFER_BIT is GL_COLOR_BUFFER_BIT.
  • Numeric GL types are number, except GLint64 and GLuint64, which are bigint. GLboolean is boolean.

Your editor's completions list every exported binding. The OpenGL guide's Use the bindings section covers singular helpers such as gl.genBuffer, typed arrays, and the commands that are not exported.

Only the info-log readers below differ from C: they read the whole log and return it as a string.

Functions ​

FunctionDescription
getProgramInfoLogReads the info log for a program object, containing linking diagnostics.
getProgramPipelineInfoLogReads the info log for a program pipeline object, containing validation diagnostics.
getShaderInfoLogReads the info log for a shader object, containing compilation diagnostics.