package raylib

  1. Overview
  2. Docs
OCaml bindings for raylib

Install

Dune Dependency

Authors

Maintainers

Sources

raylib-ocaml-0.1.tar.gz
md5=a35e88680caccd5a519cb859d2d7ae6a
sha512=f8e8ed46afe903485c81964c54d434911e208ea9a8a853599cc368860f106ebc3872205c51b40b8148140cd1288447e68737313cd065cdc8d7207043f0bc0758

doc/src/raylib.types/raylib_types.ml.html

Source file raylib_types.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
module Descriptions (F : Cstubs.Types.TYPE) = struct
  open Ctypes
  open F

  module Vector2 = struct
    type t = [ `Vector2 ]

    let t : t structure typ = structure "Vector2"

    let x = field t "x" float

    let y = field t "y" float

    let () = seal t
  end

  module Vector3 = struct
    type t = [ `Vector3 ]

    let t : t structure typ = structure "Vector3"

    let x = field t "x" float

    let y = field t "y" float

    let z = field t "z" float

    let () = seal t
  end

  module Vector4 = struct
    type t = [ `Vector4 ]

    let t : t structure typ = structure "Vector4"

    let x = field t "x" float

    let y = field t "y" float

    let z = field t "z" float

    let w = field t "w" float

    let () = seal t
  end

  module Matrix = struct
    type t = [ `Matrix ]

    let t : t structure typ = structure "Matrix"

    let m0 = field t "m0" float

    let m4 = field t "m4" float

    let m8 = field t "m8" float

    let m12 = field t "m12" float

    let m1 = field t "m1" float

    let m5 = field t "m5" float

    let m9 = field t "m9" float

    let m13 = field t "m13" float

    let m2 = field t "m2" float

    let m6 = field t "m6" float

    let m10 = field t "m10" float

    let m14 = field t "m14" float

    let m3 = field t "m3" float

    let m7 = field t "m7" float

    let m11 = field t "m11" float

    let m15 = field t "m15" float

    let () = seal t
  end

  module Color = struct
    type t = [ `Color ]

    let t : t structure typ = structure "Color"

    let r = field t "r" uint8_t

    let g = field t "g" uint8_t

    let b = field t "b" uint8_t

    let a = field t "a" uint8_t

    let () = seal t
  end

  module Rectangle = struct
    type t = [ `Rectangle ]

    let t : t structure typ = structure "Rectangle"

    let x = field t "x" float

    let y = field t "y" float

    let width = field t "width" float

    let height = field t "height" float

    let () = seal t
  end

  module PixelFormat = struct
    type t =
      | UncompressedGrayscale
      | UncompressedGrayAlpha
      | UncompressedR5G6B5
      | UncompressedR8G8B8
      | UncompressedR5G5B5A1
      | UncompressedR4G4B4A4
      | UncompressedR8G8B8A8
      | UncompressedR32
      | UncompressedR32G32B32
      | UncompressedR32G32B32A32
      | CompressedDxt1Rgb
      | CompressedDxt1Rgba
      | CompressedDxt3Rgba
      | CompressedDxt5Rgba
      | CompressedEtc1Rgb
      | CompressedEtc2Rgb
      | CompressedEtc2EacRgba
      | CompressedPvrtRgb
      | CompressedPvrtRgba
      | CompressedAstc4X4Rgba
      | CompressedAstc8X8Rgba

    let t =
      enum ~typedef:true "PixelFormat"
        [
          (UncompressedGrayscale, constant "UNCOMPRESSED_GRAYSCALE" int64_t);
          (UncompressedGrayAlpha, constant "UNCOMPRESSED_GRAY_ALPHA" int64_t);
          (UncompressedR5G6B5, constant "UNCOMPRESSED_R5G6B5" int64_t);
          (UncompressedR8G8B8, constant "UNCOMPRESSED_R8G8B8" int64_t);
          (UncompressedR5G5B5A1, constant "UNCOMPRESSED_R5G5B5A1" int64_t);
          (UncompressedR4G4B4A4, constant "UNCOMPRESSED_R4G4B4A4" int64_t);
          (UncompressedR8G8B8A8, constant "UNCOMPRESSED_R8G8B8A8" int64_t);
          (UncompressedR32, constant "UNCOMPRESSED_R32" int64_t);
          (UncompressedR32G32B32, constant "UNCOMPRESSED_R32G32B32" int64_t);
          ( UncompressedR32G32B32A32,
            constant "UNCOMPRESSED_R32G32B32A32" int64_t );
          (CompressedDxt1Rgb, constant "COMPRESSED_DXT1_RGB" int64_t);
          (CompressedDxt1Rgba, constant "COMPRESSED_DXT1_RGBA" int64_t);
          (CompressedDxt3Rgba, constant "COMPRESSED_DXT3_RGBA" int64_t);
          (CompressedDxt5Rgba, constant "COMPRESSED_DXT5_RGBA" int64_t);
          (CompressedEtc1Rgb, constant "COMPRESSED_ETC1_RGB" int64_t);
          (CompressedEtc2Rgb, constant "COMPRESSED_ETC2_RGB" int64_t);
          (CompressedEtc2EacRgba, constant "COMPRESSED_ETC2_EAC_RGBA" int64_t);
          (CompressedPvrtRgb, constant "COMPRESSED_PVRT_RGB" int64_t);
          (CompressedPvrtRgba, constant "COMPRESSED_PVRT_RGBA" int64_t);
          (CompressedAstc4X4Rgba, constant "COMPRESSED_ASTC_4x4_RGBA" int64_t);
          (CompressedAstc8X8Rgba, constant "COMPRESSED_ASTC_8x8_RGBA" int64_t);
        ]
  end

  module Image = struct
    type t = [ `Image ]

    let t : t structure typ = structure "Image"

    let data = field t "data" (ptr void)

    let width = field t "width" int

    let height = field t "height" int

    let mipmaps = field t "mipmaps" int

    let format = field t "format" PixelFormat.t

    let () = seal t
  end

  module Texture2D = struct
    type t = [ `Texture2D ]

    let t : t structure typ = structure "Texture2D"

    let id = field t "id" int

    let width = field t "width" int

    let height = field t "height" int

    let mipmaps = field t "mipmaps" int

    let format = field t "format" PixelFormat.t

    let () = seal t
  end

  module RenderTexture2D = struct
    type t = [ `RenderTexture2D ]

    let t : t structure typ = structure "RenderTexture2D"

    let texture = field t "texture" Texture2D.t

    let depth = field t "depth" Texture2D.t

    let depth_texture = field t "depthTexture" bool

    let () = seal t
  end

  module NPatchType = struct
    type t = NinePatch | ThreePatchVertical | ThreePatchHorizontal

    let t =
      enum ~typedef:true "NPatchType"
        [
          (NinePatch, constant "NPT_9PATCH" int64_t);
          (ThreePatchVertical, constant "NPT_3PATCH_VERTICAL" int64_t);
          (ThreePatchHorizontal, constant "NPT_3PATCH_HORIZONTAL" int64_t);
        ]
  end

  module NPatchInfo = struct
    type t = [ `NPatchInfo ]

    let t : t structure typ = structure "NPatchInfo"

    let source_rec = field t "sourceRec" Rectangle.t

    let left = field t "left" int

    let top = field t "top" int

    let right = field t "right" int

    let bottom = field t "bottom" int

    let typ = field t "type" NPatchType.t

    let () = seal t
  end

  module CharInfo = struct
    type t = [ `CharInfo ]

    let t : t structure typ = structure "CharInfo"

    let value = field t "value" int

    let offset_x = field t "offsetX" int

    let offset_y = field t "offsetY" int

    let advance_x = field t "advanceX" int

    let image = field t "image" Image.t

    let () = seal t
  end

  module Font = struct
    type t = [ `Font ]

    let t : t structure typ = structure "Font"

    let base_size = field t "baseSize" int

    let chars_count = field t "charsCount" int

    let texture = field t "texture" Texture2D.t

    let recs = field t "recs" (ptr Rectangle.t)

    let chars = field t "chars" (ptr CharInfo.t)

    let () = seal t
  end

  module CameraType = struct
    type t = Perspective | Orthographic

    let t =
      enum ~typedef:true "CameraType"
        [
          (Perspective, constant "CAMERA_PERSPECTIVE" int64_t);
          (Orthographic, constant "CAMERA_ORTHOGRAPHIC" int64_t);
        ]
  end

  module Camera3D = struct
    type t = [ `Camera3D ]

    let t : t structure typ = structure "Camera3D"

    let position = field t "position" Vector3.t

    let target = field t "target" Vector3.t

    let up = field t "up" Vector3.t

    let fovy = field t "fovy" float

    let typ = field t "type" CameraType.t

    let () = seal t
  end

  module Camera2D = struct
    type t = [ `Camera2D ]

    let t : t structure typ = structure "Camera2D"

    let offset = field t "offset" Vector2.t

    let target = field t "target" Vector2.t

    let rotation = field t "rotation" float

    let zoom = field t "zoom" float

    let () = seal t
  end

  (* we are getting lazy. will update fields once/if we need them *)
  module Mesh = struct
    type t = [ `Mesh ]

    let t : t structure typ = structure "Mesh"

    let () = seal t
  end

  module Shader = struct
    type t = [ `Shader ]

    let t : t structure typ = structure "Shader"

    let () = seal t
  end

  module MaterialMap = struct
    type t = [ `MaterialMap ]

    let t : t structure typ = structure "MaterialMap"

    let () = seal t
  end

  module Material = struct
    type t = [ `Material ]

    let t : t structure typ = structure "Material"

    let () = seal t
  end

  module Transform = struct
    type t = [ `Transform ]

    let t : t structure typ = structure "Transform"

    let () = seal t
  end

  module BoneInfo = struct
    type t = [ `BoneInfo ]

    let t : t structure typ = structure "BoneInfo"

    let () = seal t
  end

  module Model = struct
    type t = [ `Model ]

    let t : t structure typ = structure "Model"

    let () = seal t
  end

  module ModelAnimation = struct
    type t = [ `ModelAnimation ]

    let t : t structure typ = structure "ModelAnimation"

    let () = seal t
  end

  module Ray = struct
    type t = [ `Ray ]

    let t : t structure typ = structure "Ray"

    let position = field t "position" Vector3.t

    let direction = field t "direction" Vector3.t

    let () = seal t
  end

  module RayHitInfo = struct
    type t = [ `RayHitInfo ]

    let t : t structure typ = structure "RayHitInfo"

    let hit = field t "hit" bool

    let distance = field t "distance" float

    let position = field t "position" Vector3.t

    let normal = field t "normal" Vector3.t

    let () = seal t
  end

  module BoundingBox = struct
    type t = [ `BoundingBox ]

    let t : t structure typ = structure "BoundingBox"

    let min = field t "min" Vector3.t

    let max = field t "max" Vector3.t

    let () = seal t
  end

  module Wave = struct
    type t = [ `Wave ]

    let t : t structure typ = structure "Wave"

    let () = seal t
  end

  module AudioStream = struct
    type t = [ `AudioStream ]

    let t : t structure typ = structure "AudioStream"

    let () = seal t
  end

  module Sound = struct
    type t = [ `Sound ]

    let t : t structure typ = structure "Sound"

    let () = seal t
  end

  module Music = struct
    type t = [ `Music ]

    let t : t structure typ = structure "Music"

    let () = seal t
  end

  module ConfigFlag = struct
    let t = uint32_t

    let reserved = constant "FLAG_RESERVED" uint32_t

    let fullscreen = constant "FLAG_FULLSCREEN_MODE" uint32_t

    let resizable = constant "FLAG_WINDOW_RESIZABLE" uint32_t

    let undecorated = constant "FLAG_WINDOW_UNDECORATED" uint32_t

    let transparent = constant "FLAG_WINDOW_TRANSPARENT" uint32_t

    let hidden = constant "FLAG_WINDOW_HIDDEN" uint32_t

    let always_run = constant "FLAG_WINDOW_ALWAYS_RUN" uint32_t

    let msaa_4x_hint = constant "FLAG_MSAA_4X_HINT" uint32_t

    let vsync_hint = constant "FLAG_VSYNC_HINT" uint32_t

    let ( + ) = Unsigned.UInt32.logor
  end
end
OCaml

Innovation. Community. Security.