package tgls

  1. Overview
  2. Docs
Thin bindings to OpenGL {3,4} and OpenGL ES {2,3} for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

tgls-0.9.0.tbz
sha512=66f6d3db01c38a6238f46a5b74630e112c178648877c6d39dcb6f0ed646a799db66b8dd6d1070ab063a04fec6244483b6fd46e6bfb13798f91191dcbaac71bc9

doc/tgls.tgl3/Tgl3/index.html

Module Tgl3

OpenGL 3.x thin bindings.

Tgl3 can program core OpenGL 3.2 and 3.3 contexts. Consult the binding conventions.

Open the module use it, this defines only the module Gl in your scope.

References

OpenGL 3.x

module Gl : sig ... end

OpenGL 3.x bindings.

Conventions

To find the name of an OCaml function corresponding to a C function name, map the gl prefix to the module name Tgl3.Gl, add an underscore between each minuscule and majuscule and lower case the result. For example glGetError maps to Tgl3.Gl.get_error

To find the name of an OCaml value corresponding to a C enumerant name, map the GL_ prefix to the module name Tgl3.Gl and lower case the rest. For example GL_COLOR_BUFFER_BIT maps to Tgl3.Gl.color_buffer_bit.

The following exceptions occur:

  • A few enumerant names do clash with functions name. In that case we postfix the enumerant name with _enum. For example we have Tgl3.Gl.viewport and Tgl3.Gl.viewport_enum.
  • If applying the above procedures results in an identifier that doesn't start with a letter, prefix the identifier with a '_'.
  • If applying the above procedures results in an identifier that is an OCaml keyword, suffix the identifier with a '_'.
OCaml

Innovation. Community. Security.