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.8.5.tbz
sha256=a3b52ce7ff6ec038a0668da7aac12b1e52fb2494e9bfc8570d29c7fc8644ac75
md5=edef81b61515f9fceb21ffa5c122847e

Description

Tgls is a set of independent OCaml libraries providing thin bindings to OpenGL libraries. It has support for core OpenGL 3.{2,3} and 4.{0,1,2,3,4} and OpenGL ES 2 and 3.{0,1,2}.

Tgls depends on ocaml-ctypes and the C OpenGL library of your platform. It is distributed under the ISC license.

README

Tgls — Thin bindings to OpenGL {3,4} and OpenGL ES {2,3} for OCaml

v0.8.5

Tgls is a set of independent OCaml libraries providing thin bindings to OpenGL libraries. It has support for core OpenGL 3.{2,3} and 4.{0,1,2,3,4} and OpenGL ES 2 and 3.{0,1,2}.

Tgls depends on ocaml-ctypes and the C OpenGL library of your platform. It is distributed under the ISC license.

Home page: http://erratique.ch/software/tgls
Contact: Daniel Bünzli <daniel.buenzl i@erratique.ch>

Installation

Tgls can be installed with opam:

opam install tgls

If you don't use opam consult the opam file for build instructions and a complete specification of the dependencies.

Supported OpenGL versions

Tgls provides four libraries and corresponding ocamlfind packages:

  • tgl3, supports all functions and enumerants to program with a core OpenGL 3.2 or OpenGL 3.3 context.

  • tgl4, supports all functions and enumerants to program with a core OpenGL 4.0 to 4.5 context.

  • tgles2, supports all functions and enumerants to program with an OpenGL ES 2.0 context.

  • tgles3, supports all functions and enumerants to program with an OpenGL ES 3.0 to 3.2 context.

Compatibility contexts are not supported. For extensions, most of them only add few entry points and/or enumerants, as such it seems the easiest way to access them is to manually use ocaml-ctypes and the appropriate constants (the tools in support could be enhanced to support them but it's not planned to do so).

Documentation

The documentation and API reference is automatically generated by from the interfaces, it can be consulted online.

Sample programs

If you installed tgls with opam sample programs are located in the directory opam config var tgls:doc. Their source has a comment on how to compile them.

In the distribution sample programs are located in the test directory of the distribution. You'll need tsdl to compile them.

They can be built with:

ocamlbuild -use-ocamlfind tests.otarget

The resulting binaries are in _build/test :

  • linkgl{3,4,es2,es3}.native, tests that the C OpenGL library is correctly linked, the executables should exit with 0.

  • trigl{3,4,es2,es3}.native, opens a window and draws a tricolor triangle, needs tsdl.

The C file assert_sizes.c is a program that should exit with 0 on your platform to ensure the bindings will work correctly.

Dependencies (7)

  1. ctypes-foreign
  2. ctypes >= "0.4.0" & < "0.21.0"
  3. base-bytes
  4. topkg build
  5. ocamlbuild build
  6. ocamlfind build
  7. ocaml >= "4.01.0" & < "5.0"

Dev Dependencies (2)

  1. result with-test
  2. tsdl with-test

Used by (1)

  1. vimebac

Conflicts

None

OCaml

Innovation. Community. Security.