Gl_legacyThe gl-legacy library is a minimal set of OCaml bindings to the venerable openGL 2.1 immediate mode. In particular, it includes Display Lists, and the interesting Feedback mode.
gl-legacy can be used by itself (see the triangle or cube example), but more reasonably it should be thought of as an add-on to the more modern tgls bindings.
When mixing this library with tgls, it is convenient to use the following aliases: (for instance if you target OpenGL 3.x)
module Gl = Gl_legacy
module Gl3 = Tgl3.GlIn this way you may write things such as
Gl3.bind_texture Gl3.texture_2d tex_id;
Gl.enable Gl.texture_2dThen, when you have the courage to update your work to remove deprecated OpenGL 1-2 functions, they will be easy to spot.
val enum_to_int : enum -> intval int_to_enum : int -> enumtype matrixf =
(float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t4x4 Matrices are flattened to 1D arrays of size 16. (column major: the first 4 elements are the first column, etc.)
type display_list = enumFor documentation, see here.
In particular, that doc tells you the meaning of the arguments, and which OpenGL constants (enums) are valid parameters for each function.
If you don't find a function below, it is maybe because it still exists in OpenGL 3, and hence can be found from tgls. For instance if you want to use OpenGL 3.x you should consult:
tsdl.tgl3 (OpenGL 3.x bindings)val call_list : enum -> unitval call_lists : enum array -> unitval clear : enum -> unitval copy_pixels : int -> int -> int -> int -> enum -> unitval delete_lists : enum -> int -> unitval disable : enum -> unitval enable : enum -> unitval gen_lists : int -> enumval gl_begin : enum -> unitval light_modelf : enum -> float -> unitval light_modelfv : enum -> float array -> unitval list_mode_enum : display_list_mode -> enumval load_matrixd : matrixd -> unitval load_matrixf : matrixf -> unitval matrix_mode : enum -> unitval mult_matrixd : matrixd -> unitval mult_matrixf : matrixf -> unitval new_list : enum -> display_list_mode -> unitval render_mode : render_mode -> intval render_mode_enum : render_mode -> enumval ambient : enumval ambient_and_diffuse : enumval back : enumval blend : enumval color : enumval color_buffer_bit : enumval color_indexes : enumval color_material_enum : enumval cull_face : enumval decal : enumval depth : enumval depth_buffer_bit : enumval depth_test : enumval diffuse : enumval emission : enumval feedback : enumval front : enumval front_and_back : enumval light0 : enumval light_model_ambient : enumval light_model_local_viewer : enumval light_model_two_side : enumval lighting : enumval line_loop : enumval line_smooth : enumval line_strip : enumval lines : enumval modelview : enumval modulate : enumval normalize : enumval point_smooth : enumval points : enumval polygon : enumval polygon_smooth : enumval position : enumval projection : enumval quad_strip : enumval quads : enumval render : enumval replace : enumval select : enumval shininess : enumval specular : enumval stencil : enumval stencil_buffer_bit : enumval texture : enumval texture_2d : enumval texture_env : enumval texture_env_color : enumval texture_env_mode : enumval triangle_fan : enumval triangle_strip : enumval triangles : enumval compile : enumval compile_and_execute : enummodule List_type : sig ... endConstants for Display Lists
module Feedback : sig ... endFunctions and constants for Feedback mode