1 (* $Id: glArray.ml,v 1.6 2008-10-30 07:51:33 garrigue Exp $ *)
6 type kind
= [`edge_flag
| `texture_coord
| `color
| `index
| `normal
| `vertex
]
8 let check_static func f raw
=
9 if not
(Raw.static raw
) then
10 invalid_arg
("GlArray." ^ func ^
" : buffer must be static");
13 external _edge_flag
: [< `bitmap
] Raw.t
-> unit = "ml_glEdgeFlagPointer"
14 let edge_flag raw
= check_static "edge_flag" _edge_flag raw
17 [< `one
| `two
| `three
| `four
] ->
18 [< `short
| `
int | `
float | `double
] Raw.t
-> unit
19 = "ml_glTexCoordPointer"
20 let tex_coord n
= check_static "tex_coord" (_tex_coord n
)
24 [< `byte
| `ubyte
| `short
| `ushort
| `
int | `uint
| `
float | `double
] Raw.t
27 let color n
= check_static "color" (_color n
)
29 external _index
: [< `ubyte
| `short
| `
int | `
float | `double
] Raw.t
-> unit
31 let index raw
= check_static "index" _index raw
33 external _normal
: [< `byte
| `short
| `
int | `
float | `double
] Raw.t
-> unit
34 = "ml_glNormalPointer"
35 let normal raw
= check_static "normal" _normal raw
38 [< `two
| `three
| `four
] -> [< `short
| `
int | `
float | `double
] Raw.t
40 = "ml_glVertexPointer"
41 let vertex n
= check_static "vertex" (_vertex n
)
43 external enable
: kind
-> unit= "ml_glEnableClientState"
45 external disable
: kind
-> unit = "ml_glDisableClientState"
47 external element
: int -> unit = "ml_glArrayElement"
49 external draw_arrays
: GlDraw.shape
-> first
:int -> count
:int -> unit
52 external draw_elements
53 : GlDraw.shape
-> count
:int -> [< `ubyte
| `ushort
| `uint
] Raw.t
-> unit