1 (* $Id: glArray.ml,v 1.6 2008-10-30 07:51:33 garrigue Exp $ *)
3 type kind
= [`edge_flag
| `texture_coord
| `color
| `index
| `normal
| `vertex
]
5 let check_static func f raw
=
6 if not
(Raw.static raw
) then
7 invalid_arg
("GlArray." ^ func ^
" : buffer must be static");
10 external _edge_flag
: [< `bitmap
] Raw.t
-> unit = "ml_glEdgeFlagPointer"
11 let edge_flag raw
= check_static "edge_flag" _edge_flag raw
14 [< `one
| `two
| `three
| `four
] ->
15 [< `short
| `
int | `
float | `double
] Raw.t
-> unit
16 = "ml_glTexCoordPointer"
17 let tex_coord n
= check_static "tex_coord" (_tex_coord n
)
21 [< `byte
| `ubyte
| `short
| `ushort
| `
int | `uint
| `
float | `double
] Raw.t
24 let color n
= check_static "color" (_color n
)
26 external _index
: [< `ubyte
| `short
| `
int | `
float | `double
] Raw.t
-> unit
28 let index raw
= check_static "index" _index raw
30 external _normal
: [< `byte
| `short
| `
int | `
float | `double
] Raw.t
-> unit
31 = "ml_glNormalPointer"
32 let normal raw
= check_static "normal" _normal raw
35 [< `two
| `three
| `four
] -> [< `short
| `
int | `
float | `double
] Raw.t
37 = "ml_glVertexPointer"
38 let vertex n
= check_static "vertex" (_vertex n
)
40 external enable
: kind
-> unit= "ml_glEnableClientState"
42 external disable
: kind
-> unit = "ml_glDisableClientState"
44 external element
: int -> unit = "ml_glArrayElement"
46 external draw_arrays
: GlDraw.shape
-> first
:int -> count
:int -> unit
49 external draw_elements
50 : GlDraw.shape
-> count
:int -> [< `ubyte
| `ushort
| `uint
] Raw.t
-> unit