package gl-legacy

All checked builds pass
  1. Overview
  2. Docs
Legacy OpenGL immediate-mode bindings for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.1.0.tar.gz
md5=529c107fcf0b2c8db22e84f2736e376b
sha512=f5dd6c410abdb0699cb1d3bb5d6ecf7fbbc8fc48e8a5df21c5ce9b5cb63cf66bcb34c6ac118007eae7b41c0f3481ea7dc6e789a58fdc1a019d56274089ff3a28

Description

Quick bindings to old-style OpenGL (glBegin/glEnd, fixed-function transforms, matrix stack), Display Lists, Feedback Mode. For teaching or reviving legacy code. Can be used together with [tgls] for a complete openGL coverage.

Tags

plot 2D 3D graphics openGL

Added to opam-repository:

README

gl-legacy

Legacy OpenGL immediate-mode bindings for OCaml

Use this together with tgls for a complete coverage of (more) modern OpenGL.

Work in Progress

API Documentation

https://sanette.github.io/gl-legacy/

Examples

To run the demos:

  • Make sure tsdl is installed, or run
opam install tsdl
  • Then
mv bin/dune.moveme bin/dune
dune exec bin/triangle.exe
dune exec bin/cube.exe
dune exec bin/cube_lit.exe
dune exec bin/cube_list.exe
trianglecube

This one requires in addition tsdl-image and tgls:

cd bin; dune exec ./image_quad.exe

Code sample

(...)

    Gl_legacy.gl_begin Gl_legacy.triangles;
    Gl_legacy.color3f 1.0 0.0 0.0;
    Gl_legacy.vertex2f 0.0 0.8;
    Gl_legacy.color3f 0.0 1.0 0.0;
    Gl_legacy.vertex2f (-0.8) (-0.8);
    Gl_legacy.color3f 0.0 0.0 1.0;
    Gl_legacy.vertex2f 0.8 (-0.8);
    Gl_legacy.gl_end ();

(...)

But why?

  • Why old openGL?

Because it's a lot easier to program, has some pedagogical value, and allows me to run old code I wrote in the the good old times.

  • But there's already lablgl and glMLite!

True. Good question. The goal is to have a minimal set of bindings that would complement tgls (See the image_quad example).

Dependencies (5)

  1. conf-libgl os != "macos" & os != "win32"
  2. ctypes-foreign >= "0.21.1"
  3. ctypes
  4. ocaml >= "4.14"
  5. dune >= "3.15"

Dev Dependencies (1)

  1. odoc with-doc

Optional Dependencies

None

Used by (1)

  1. oplot >= "0.80"

Conflicts

None

Build status

Results of building gl-legacy with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.1.0 (this version) n/a good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure