module FunGL:sig..end
An experimental attempt at a functional interface to OpenGL.
This module tries 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.
typevertex2 =float * float
(x,y)
typevertex3 =float * float * float
(x,y,z)
typevertex4 =float * float * float * float
(x,y,z,w)
typevector =float * float * float
typergb =float * float * float
typergba =float * float * float * float
typeuv =float * float
typematrix4x4 =float array
val draw_translated : vector -> (unit -> unit) -> unitval draw_rotated : float -> vector -> (unit -> unit) -> unitval draw_scaled : vector -> (unit -> unit) -> unitval draw_as_identity : (unit -> unit) -> unitval draw_with_matrix : matrix4x4 -> (unit -> unit) -> unitval draw_with_rgb : rgb -> (unit -> unit) -> unitval draw_with_rgba : rgba -> (unit -> unit) -> unitval draw_with_material : face:GL.face_mode -> mode:GL.Material.material_mode -> (unit -> unit) -> unitval draw_with_lightModel : light_model:GL.light_model -> (unit -> unit) -> unitval draw_with_shadeModel : shade_mode:GL.shade_mode -> (unit -> unit) -> unitval draw_with_frontFace : orientation:GL.orientation -> (unit -> unit) -> unituse this function as replacement of GL.glFrontFace
val draw_with_cullFace : mode:GL.face_mode -> (unit -> unit) -> unituse this function as replacement of GL.glCullFace
val draw_enabled : cap:GL.gl_capability -> (unit -> unit) -> unituse this function as replacement of GL.glEnable
val with_enablements : caps:GL.gl_capability list -> (unit -> unit) -> unitsame than draw_enabled but with several capabilities
val draw_disabled : cap:GL.gl_capability -> (unit -> unit) -> unituse this function as replacement of GL.glDisable
val draw_with_viewport : viewport:int * int * int * int -> (unit -> unit) -> unituse 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) -> unituse this function as replacement of GL.glPolygonMode
val draw_with_polygonMode2 : front:GL.polygon_mode -> back:GL.polygon_mode -> (unit -> unit) -> unituse this function as replacement of GL.glPolygonMode
val do_with_matrixMode : mode:GL.matrix_mode -> (unit -> unit) -> unitval draw_with_lineWidth : width:float -> (unit -> unit) -> unituse this function as replacement of GL.glLineWidth,
in OpenGL >= 3.0, this function does not support values greater than 1.0 anymore.
val draw_with_pointSize : size:float -> (unit -> unit) -> unituse this function as replacement of GL.glPointSize
val draw_using_program : program:GL.shader_program -> (unit -> unit) -> unittype qualified_vertices =
| |
Vertices2 of |
| |
Vertices3 of |
| |
Vertices4 of |
| |
Normal_Vertices2 of |
| |
Normal_Vertices3 of |
| |
Normal_Vertices4 of |
| |
RGB_Vertices2 of |
| |
RGB_Vertices3 of |
| |
RGB_Vertices4 of |
| |
RGBA_Vertices2 of |
| |
RGBA_Vertices3 of |
| |
RGBA_Vertices4 of |
| |
Normal_RGB_Vertices2 of |
| |
Normal_RGB_Vertices3 of |
| |
Normal_RGB_Vertices4 of |
| |
Normal_RGBA_Vertices2 of |
| |
Normal_RGBA_Vertices3 of |
| |
Normal_RGBA_Vertices4 of |
| |
UV_Vertices2 of |
| |
UV_Vertices3 of |
| |
UV_Vertices4 of |
| |
UV_Normal_Vertices2 of |
| |
UV_Normal_Vertices3 of |
| |
UV_Normal_Vertices4 of |
| |
UV_RGB_Vertices2 of |
| |
UV_RGB_Vertices3 of |
| |
UV_RGB_Vertices4 of |
| |
UV_RGBA_Vertices2 of |
| |
UV_RGBA_Vertices3 of |
| |
UV_RGBA_Vertices4 of |
| |
UV_Normal_RGB_Vertices2 of |
| |
UV_Normal_RGB_Vertices3 of |
| |
UV_Normal_RGB_Vertices4 of |
| |
UV_Normal_RGBA_Vertices2 of |
| |
UV_Normal_RGBA_Vertices3 of |
| |
UV_Normal_RGBA_Vertices4 of |
val render_primitive : GL.primitive -> qualified_vertices -> unitOgl_draw.make_mesh and Ogl_draw.draw_mesh instead.