Module OgamlGraphics.Program

High-level wrapper around GL shader programs

This module provides a high-level wrapper around GL shader programs and can be used to compile shaders.

exception Program_error of string
Raised when an error occurs during the manipulation of a program
type t
Type of a program
type src = [ `File of string | `String of string]
Type of a source, from a file or from a string
val from_source : (module RenderTarget.T with type t = 'a) -> ?log:OgamlUtils.Log.t -> context:'a -> vertex_source:src -> fragment_source:src -> unit -> t
Compiles a program from a rendering context, a vertex source and a fragment source. Compilation errors will be reported on the provided log. The source must begin with a version assigment #version xxx
See : OgamlUtils.Log
val from_source_list : (module RenderTarget.T with type t = 'a) -> ?log:OgamlUtils.Log.t -> context:'a -> vertex_source:(int * src) list -> fragment_source:(int * src) list -> unit -> t
Compiles a program from a rendering context and a list of sources paired with their required GLSL version. The function will chose the best source for the current context. Compilation errors will be reported on the provided log.
See : OgamlGraphics.Context
See : OgamlUtils.Log
val from_source_pp : (module RenderTarget.T with type t = 'a) -> ?log:OgamlUtils.Log.t -> context:'a -> vertex_source:src -> fragment_source:src -> unit -> t
Compiles a program from a rendering context and a source. The source should not begin with a #version xxx assignment, as the function will preprocess the sources and prepend the best version declaration. Compilation errors will be reported on the provided log.

See : OgamlGraphics.Context
See : OgamlUtils.Log