Move guard where it belongs
[llpp/slowscroll.git] / lablGL / glFunc.ml
blob240a12ecef1098f5a5e63dc58b7065672a19768a
1 (* $Id: glFunc.ml,v 1.7 2000-04-12 07:40:23 garrigue Exp $ *)
3 open Gl
5 external accum : op:[`accum|`load|`add|`mult|`return] -> float -> unit
6 = "ml_glAccum"
7 external alpha_func : cmp_func -> ref:clampf -> unit = "ml_glAlphaFunc"
9 type sfactor = [
10 `zero
11 | `one
12 | `dst_color
13 | `one_minus_dst_color
14 | `src_alpha
15 | `one_minus_src_alpha
16 | `dst_alpha
17 | `one_minus_dst_alpha
18 | `src_alpha_saturate
20 type dfactor = [
21 `zero
22 | `one
23 | `src_color
24 | `one_minus_src_color
25 | `src_alpha
26 | `one_minus_src_alpha
27 | `dst_alpha
28 | `one_minus_dst_alpha
30 external blend_func : src:sfactor -> dst:dfactor -> unit = "ml_glBlendFunc"
32 external color_mask : bool -> bool -> bool -> bool -> unit
33 = "ml_glColorMask"
34 let color_mask ?(red=false) ?(green=false) ?(blue=false) ?(alpha=false) ()=
35 color_mask red green blue alpha
37 external depth_func : cmp_func -> unit = "ml_glDepthFunc"
38 external depth_mask : bool -> unit = "ml_glDepthMask"
39 external depth_range : near:float -> far:float -> unit = "ml_glDepthRange"
41 type draw_buffer =
42 [`none|`front_left|`front_right|`back_left|`back_right
43 |`front|`back|`left|`right|`front_and_back|`aux of int]
44 external draw_buffer : draw_buffer -> unit = "ml_glDrawBuffer"
46 external index_mask : int -> unit = "ml_glIndexMask"
48 type logic_op =
49 [`clear|`set|`copy|`copy_inverted|`noop|`invert|`And|`nand|`Or|`nor
50 |`xor|`equiv|`and_reverse|`and_inverted|`or_reverse|`or_inverted]
51 external logic_op : logic_op -> unit = "ml_glLogicOp"
53 type read_buffer =
54 [`front_left|`front_right|`back_left|`back_right|`front|`back
55 |`left|`right|`aux of int]
56 external read_buffer : read_buffer -> unit = "ml_glReadBuffer"
58 external stencil_func : cmp_func -> ref:int -> mask:int -> unit
59 = "ml_glStencilFunc"
60 external stencil_mask : int -> unit = "ml_glStencilMask"
61 type stencil_op = [`keep|`zero|`replace|`incr|`decr|`invert]
62 external stencil_op :
63 fail:stencil_op -> zfail:stencil_op -> zpass:stencil_op -> unit
64 = "ml_glStencilOp"
65 let stencil_op ?(fail=`keep) ?(zfail=`keep) ?(zpass=`keep) () =
66 stencil_op ~fail ~zfail ~zpass