module FunGL: sig
.. end
An experimental attempt at a functional interface to OpenGL.
This module trys to be a functional wrapper around OpenGL,
so you don't have to think about the side effects and restoring
the previous gl state when using these functions.
You can set parameters for a local effect.
type
vertex2 = float * float
(x,y)
type
vertex3 = float * float * float
(x,y,z)
type
vertex4 = float * float * float * float
(x,y,z,w)
type
vector = float * float * float
type
rgb = float * float * float
type
rgba = float * float * float * float
type
uv = float * float
type
matrix4x4 = float array
type
qualified_vertices =
val render_primitive : GL.primitive -> qualified_vertices -> unit
render the given list of qualified vertices as the required primitive
val draw_translated : vector -> (unit -> unit) -> unit
val draw_rotated : float -> vector -> (unit -> unit) -> unit
val draw_scaled : vector -> (unit -> unit) -> unit
val draw_as_identity : (unit -> unit) -> unit
val draw_with_matrix : matrix4x4 -> (unit -> unit) -> unit
val draw_with_rgb : rgb -> (unit -> unit) -> unit
val draw_with_rgba : rgba -> (unit -> unit) -> unit
val draw_with_material : face:GL.face_mode -> mode:GL.Material.material_mode -> (unit -> unit) -> unit
val draw_with_lightModel : light_model:GL.light_model -> (unit -> unit) -> unit
val draw_with_shadeModel : shade_mode:GL.shade_mode -> (unit -> unit) -> unit
val draw_with_frontFace : orientation:GL.orientation -> (unit -> unit) -> unit
val draw_enabled : cap:GL.gl_capability -> (unit -> unit) -> unit
val draw_disabled : cap:GL.gl_capability -> (unit -> unit) -> unit
val draw_with_viewport : viewport:int * int * int * int -> (unit -> unit) -> unit
use this function instead of
GL.glViewport
when you use a local viewport
val draw_with_polygonMode : face:GL.face_mode -> mode:GL.polygon_mode -> (unit -> unit) -> unit
val do_with_matrixMode : mode:GL.matrix_mode -> (unit -> unit) -> unit
val draw_with_lineWidth : width:float -> (unit -> unit) -> unit
val draw_with_pointSize : size:float -> (unit -> unit) -> unit