package oglsl

All checked builds pass
  1. Overview
  2. Docs
Embedding GLSL in OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.1.0.tar.gz
md5=7d1303c6cfee60e8bc0258faaec8df33
sha512=1d688ac224242a92f9e786e01218e384c2e76aa7b41137e0160056ad8e2c3a44f333b4b4ab08ff94ac96e697a8b6701f03e9b784222f8974c27684bcb6376138

Description

Oglsl is a set of module signatures providing overloadable functions and operators and abstract types for writing GLSL in OCaml. In other words, it is a tagless-final eDSL - abstract algebra of GLSL embedded in OCaml.

Tags

tagless-final opengl glsl edsl

Added to opam-repository:

README

Oglsl

Oglsl is a set of module signatures providing overloadable functions and operators and abstract types for writing GLSL ^wiki-glsl in OCaml. In other words, it is a tagless-final ^jfp eDSL - abstract algebra of GLSL embedded in OCaml.

Oglsl isn't useful on its own. (TBA)

Example

An introduction to Oglsl is available at the wiki. For a use case of Oglsl in one short snippet, here it is:

module SHADER
(C: Oglsl.Glsl)
(C_stdlib: Oglsl.Glsl__opengl(C).S) = struct
  open C
  open C_stdlib

  let vertex_shader =
    prog begin
    (#!) version v3_3_0 core >>=+ fun _ ->
    let+ pos = In.ref__vec3 ~layout__location:0 () in
    func0 void main @@ fun () ->
      Gl.position := Vec4.of_vec3 !pos (float 1.0)
    end
end

which translates to (assuming we provide an interpreter implementation):

#version 330 core
layout(location = 0) in vec3 pos;
void main() {
  gl_Position = vec4(pos, 1.0);
}

Let's dissect what's going on:

  • TBA
  • TBA

Dependencies (2)

  1. ocaml >= "5.2.0"
  2. dune >= "3.20"

Dev Dependencies (1)

  1. odoc with-doc

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building oglsl with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. 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 n/a 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