]> gitweb.factorcode.org Git - factor.git/blob - extra/raylib/raylib.factor
factor: more top level forms.
[factor.git] / extra / raylib / raylib.factor
1 ! Copyright (C) 2019 Jack Lucas
2 ! See http:! factorcode.org/license.txt for BSD license.
3 ! These should be complete bindings to the Raylib library. (v4.0)
4 ! Most of the comments are included from the original header
5 ! for your convenience.
6 USING: accessors alien alien.c-types alien.destructors
7 alien.libraries alien.syntax classes.struct combinators kernel
8 raylib.util sequences sequences.private system ;
9 IN: raylib
10 FROM: alien.c-types => float ;
11
12 LIBRARY-UNIX: raylib cdecl "libraylib.so"
13 LIBRARY-MACOSX: raylib cdecl "libraylib.dylib"
14 LIBRARY-WINDOWS: raylib cdecl "raylib.dll"
15
16 DEPLOY-LIBRARY: raylib
17
18 LIBRARY: raylib
19
20 ! Enumerations ---------------------------------------------------------
21
22 ! Putting some of the #define's as enums.
23 ENUM: ConfigFlags
24     { FLAG_VSYNC_HINT         0x00000040 }   ! Set to try enabling V-Sync on GPU
25     { FLAG_FULLSCREEN_MODE    0x00000002 }   ! Set to run program in fullscreen
26     { FLAG_WINDOW_RESIZABLE   0x00000004 }   ! Set to allow resizable window
27     { FLAG_WINDOW_UNDECORATED 0x00000008 }   ! Set to disable window decoration (frame and buttons)
28     { FLAG_WINDOW_HIDDEN      0x00000080 }   ! Set to hide window
29     { FLAG_WINDOW_MINIMIZED   0x00000200 }   ! Set to minimize window (iconify)
30     { FLAG_WINDOW_MAXIMIZED   0x00000400 }   ! Set to maximize window (expanded to monitor)
31     { FLAG_WINDOW_UNFOCUSED   0x00000800 }   ! Set to window non focused
32     { FLAG_WINDOW_TOPMOST     0x00001000 }   ! Set to window always on top
33     { FLAG_WINDOW_ALWAYS_RUN  0x00000100 }   ! Set to allow windows running while minimized
34     { FLAG_WINDOW_TRANSPARENT 0x00000010 }   ! Set to allow transparent framebuffer
35     { FLAG_WINDOW_HIGHDPI     0x00002000 }   ! Set to support HighDPI
36     { FLAG_MSAA_4X_HINT       0x00000020 }   ! Set to try enabling MSAA 4X
37     { FLAG_INTERLACED_HINT    0x00010000 } ; ! Set to try enabling interlaced video format (for V3D)
38
39 ENUM: TraceLogLevel
40     LOG_ALL
41     LOG_TRACE
42     LOG_DEBUG
43     LOG_INFO
44     LOG_WARNING
45     LOG_ERROR
46     LOG_FATAL
47     LOG_NONE ;
48
49 ENUM: KeyboardKey
50     { KEY_NULL            0 }      ! Key: NULL, used for no key pressed
51     ! Alphanumeric keys
52     { KEY_APOSTROPHE      39 }     ! Key: '
53     { KEY_COMMA           44 }     ! Key: ,
54     { KEY_MINUS           45 }     ! Key: -
55     { KEY_PERIOD          46 }     ! Key: .
56     { KEY_SLASH           47 }     ! Key: /
57     { KEY_ZERO            48 }     ! Key: 0
58     { KEY_ONE             49 }     ! Key: 1
59     { KEY_TWO             50 }     ! Key: 2
60     { KEY_THREE           51 }     ! Key: 3
61     { KEY_FOUR            52 }     ! Key: 4
62     { KEY_FIVE            53 }     ! Key: 5
63     { KEY_SIX             54 }     ! Key: 6
64     { KEY_SEVEN           55 }     ! Key: 7
65     { KEY_EIGHT           56 }     ! Key: 8
66     { KEY_NINE            57 }     ! Key: 9
67     { KEY_SEMICOLON       59 }     ! Key: ;
68     { KEY_EQUAL           61 }     ! Key: =
69     { KEY_A               65 }     ! Key: A | a
70     { KEY_B               66 }     ! Key: B | b
71     { KEY_C               67 }     ! Key: C | c
72     { KEY_D               68 }     ! Key: D | d
73     { KEY_E               69 }     ! Key: E | e
74     { KEY_F               70 }     ! Key: F | f
75     { KEY_G               71 }     ! Key: G | g
76     { KEY_H               72 }     ! Key: H | h
77     { KEY_I               73 }     ! Key: I | i
78     { KEY_J               74 }     ! Key: J | j
79     { KEY_K               75 }     ! Key: K | k
80     { KEY_L               76 }     ! Key: L | l
81     { KEY_M               77 }     ! Key: M | m
82     { KEY_N               78 }     ! Key: N | n
83     { KEY_O               79 }     ! Key: O | o
84     { KEY_P               80 }     ! Key: P | p
85     { KEY_Q               81 }     ! Key: Q | q
86     { KEY_R               82 }     ! Key: R | r
87     { KEY_S               83 }     ! Key: S | s
88     { KEY_T               84 }     ! Key: T | t
89     { KEY_U               85 }     ! Key: U | u
90     { KEY_V               86 }     ! Key: V | v
91     { KEY_W               87 }     ! Key: W | w
92     { KEY_X               88 }     ! Key: X | x
93     { KEY_Y               89 }     ! Key: Y | y
94     { KEY_Z               90 }     ! Key: Z | z
95     { KEY_LEFT_BRACKET    91 }     ! Key: [
96     { KEY_BACKSLASH       92 }     ! Key: '\'
97     { KEY_RIGHT_BRACKET   93 }     ! Key: ]
98     { KEY_GRAVE           96 }     ! Key: `
99     ! Function keys
100     { KEY_SPACE           32 }     ! Key: Space
101     { KEY_ESCAPE          256 }    ! Key: Esc
102     { KEY_ENTER           257 }    ! Key: Enter
103     { KEY_TAB             258 }    ! Key: Tab
104     { KEY_BACKSPACE       259 }    ! Key: Backspace
105     { KEY_INSERT          260 }    ! Key: Ins
106     { KEY_DELETE          261 }    ! Key: Del
107     { KEY_RIGHT           262 }    ! Key: Cursor right
108     { KEY_LEFT            263 }    ! Key: Cursor left
109     { KEY_DOWN            264 }    ! Key: Cursor down
110     { KEY_UP              265 }    ! Key: Cursor up
111     { KEY_PAGE_UP         266 }    ! Key: Page up
112     { KEY_PAGE_DOWN       267 }    ! Key: Page down
113     { KEY_HOME            268 }    ! Key: Home
114     { KEY_END             269 }    ! Key: End
115     { KEY_CAPS_LOCK       280 }    ! Key: Caps lock
116     { KEY_SCROLL_LOCK     281 }    ! Key: Scroll down
117     { KEY_NUM_LOCK        282 }    ! Key: Num lock
118     { KEY_PRINT_SCREEN    283 }    ! Key: Print screen
119     { KEY_PAUSE           284 }    ! Key: Pause
120     { KEY_F1              290 }    ! Key: F1
121     { KEY_F2              291 }    ! Key: F2
122     { KEY_F3              292 }    ! Key: F3
123     { KEY_F4              293 }    ! Key: F4
124     { KEY_F5              294 }    ! Key: F5
125     { KEY_F6              295 }    ! Key: F6
126     { KEY_F7              296 }    ! Key: F7
127     { KEY_F8              297 }    ! Key: F8
128     { KEY_F9              298 }    ! Key: F9
129     { KEY_F10             299 }    ! Key: F10
130     { KEY_F11             300 }    ! Key: F11
131     { KEY_F12             301 }    ! Key: F12
132     { KEY_LEFT_SHIFT      340 }    ! Key: Shift left
133     { KEY_LEFT_CONTROL    341 }    ! Key: Control left
134     { KEY_LEFT_ALT        342 }    ! Key: Alt left
135     { KEY_LEFT_SUPER      343 }    ! Key: Super left
136     { KEY_RIGHT_SHIFT     344 }    ! Key: Shift right
137     { KEY_RIGHT_CONTROL   345 }    ! Key: Control right
138     { KEY_RIGHT_ALT       346 }    ! Key: Alt right
139     { KEY_RIGHT_SUPER     347 }    ! Key: Super right
140     { KEY_KB_MENU         348 }    ! Key: KB menu
141     ! Keypad keys
142     { KEY_KP_0            320 }    ! Key: Keypad 0
143     { KEY_KP_1            321 }    ! Key: Keypad 1
144     { KEY_KP_2            322 }    ! Key: Keypad 2
145     { KEY_KP_3            323 }    ! Key: Keypad 3
146     { KEY_KP_4            324 }    ! Key: Keypad 4
147     { KEY_KP_5            325 }    ! Key: Keypad 5
148     { KEY_KP_6            326 }    ! Key: Keypad 6
149     { KEY_KP_7            327 }    ! Key: Keypad 7
150     { KEY_KP_8            328 }    ! Key: Keypad 8
151     { KEY_KP_9            329 }    ! Key: Keypad 9
152     { KEY_KP_DECIMAL      330 }    ! Key: Keypad .
153     { KEY_KP_DIVIDE       331 }    ! Key: Keypad /
154     { KEY_KP_MULTIPLY     332 }    ! Key: Keypad *
155     { KEY_KP_SUBTRACT     333 }    ! Key: Keypad -
156     { KEY_KP_ADD          334 }    ! Key: Keypad +
157     { KEY_KP_ENTER        335 }    ! Key: Keypad Enter
158     { KEY_KP_EQUAL        336 }    ! Key: Keypad =
159     ! Android key buttons
160     { KEY_BACK            4 }      ! Key: Android back button
161     { KEY_MENU            82 }     ! Key: Android menu button
162     { KEY_VOLUME_UP       24 }     ! Key: Android volume up button
163     { KEY_VOLUME_DOWN     25 } ;   ! Key: Android volume down button
164
165 ENUM: MouseButton
166     MOUSE_BUTTON_LEFT        ! Mouse button left
167     MOUSE_BUTTON_RIGHT       ! Mouse button right
168     MOUSE_BUTTON_MIDDLE      ! Mouse button middle (pressed wheel)
169     MOUSE_BUTTON_SIDE        ! Mouse button side (advanced mouse device)
170     MOUSE_BUTTON_EXTRA       ! Mouse button extra (advanced mouse device)
171     MOUSE_BUTTON_FORWARD     ! Mouse button fordward (advanced mouse device)
172     MOUSE_BUTTON_BACK ;      ! Mouse button back (advanced mouse device)
173
174 ENUM: MouseCursor
175     MOUSE_CURSOR_DEFAULT        ! Default pointer shape
176     MOUSE_CURSOR_ARROW          ! Arrow shape
177     MOUSE_CURSOR_IBEAM          ! Text writing cursor shape
178     MOUSE_CURSOR_CROSSHAIR      ! Cross shape
179     MOUSE_CURSOR_POINTING_HAND  ! Pointing hand cursor
180     MOUSE_CURSOR_RESIZE_EW      ! Horizontal resize/move arrow shape
181     MOUSE_CURSOR_RESIZE_NS      ! Vertical resize/move arrow shape
182     MOUSE_CURSOR_RESIZE_NWSE    ! Top-left to bottom-right diagonal resize/move arrow shape
183     MOUSE_CURSOR_RESIZE_NESW    ! The top-right to bottom-left diagonal resize/move arrow shape
184     MOUSE_CURSOR_RESIZE_ALL     ! The omni-directional resize/move cursor shape
185     MOUSE_CURSOR_NOT_ALLOWED ;  ! The operation-not-allowed shape
186
187 ENUM: GamepadButton
188     GAMEPAD_BUTTON_UNKNOWN             ! Unknown button, just for error checking
189     GAMEPAD_BUTTON_LEFT_FACE_UP        ! Gamepad left DPAD up button
190     GAMEPAD_BUTTON_LEFT_FACE_RIGHT     ! Gamepad left DPAD right button
191     GAMEPAD_BUTTON_LEFT_FACE_DOWN      ! Gamepad left DPAD down button
192     GAMEPAD_BUTTON_LEFT_FACE_LEFT      ! Gamepad left DPAD left button
193     GAMEPAD_BUTTON_RIGHT_FACE_UP       ! Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
194     GAMEPAD_BUTTON_RIGHT_FACE_RIGHT    ! Gamepad right button right (i.e. PS3: Square, Xbox: X)
195     GAMEPAD_BUTTON_RIGHT_FACE_DOWN     ! Gamepad right button down (i.e. PS3: Cross, Xbox: A)
196     GAMEPAD_BUTTON_RIGHT_FACE_LEFT     ! Gamepad right button left (i.e. PS3: Circle, Xbox: B)
197     GAMEPAD_BUTTON_LEFT_TRIGGER_1      ! Gamepad top/back trigger left (first), it could be a trailing button
198     GAMEPAD_BUTTON_LEFT_TRIGGER_2      ! Gamepad top/back trigger left (second), it could be a trailing button
199     GAMEPAD_BUTTON_RIGHT_TRIGGER_1     ! Gamepad top/back trigger right (one), it could be a trailing button
200     GAMEPAD_BUTTON_RIGHT_TRIGGER_2     ! Gamepad top/back trigger right (second), it could be a trailing button
201     GAMEPAD_BUTTON_MIDDLE_LEFT         ! Gamepad center buttons, left one (i.e. PS3: Select)
202     GAMEPAD_BUTTON_MIDDLE              ! Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
203     GAMEPAD_BUTTON_MIDDLE_RIGHT        ! Gamepad center buttons, right one (i.e. PS3: Start)
204     GAMEPAD_BUTTON_LEFT_THUMB          ! Gamepad joystick pressed button left
205     GAMEPAD_BUTTON_RIGHT_THUMB ;       ! Gamepad joystick pressed button right
206
207 ENUM: GamepadAxis
208     GAMEPAD_AXIS_LEFT_X                ! Gamepad left stick X axis
209     GAMEPAD_AXIS_LEFT_Y                ! Gamepad left stick Y axis
210     GAMEPAD_AXIS_RIGHT_X               ! Gamepad right stick X axis
211     GAMEPAD_AXIS_RIGHT_Y               ! Gamepad right stick Y axis
212     GAMEPAD_AXIS_LEFT_TRIGGER          ! Gamepad back trigger left, pressure level: [1..-1]
213     GAMEPAD_AXIS_RIGHT_TRIGGER ;       ! Gamepad back trigger right, pressure level: [1..-1]
214
215 ENUM: MaterialMapIndex
216     MATERIAL_MAP_ALBEDO            ! Albedo material (same as: MATERIAL_MAP_DIFFUSE)
217     MATERIAL_MAP_METALNESS         ! Metalness material (same as: MATERIAL_MAP_SPECULAR)
218     MATERIAL_MAP_NORMAL            ! Normal material
219     MATERIAL_MAP_ROUGHNESS         ! Roughness material
220     MATERIAL_MAP_OCCLUSION         ! Ambient occlusion material
221     MATERIAL_MAP_EMISSION          ! Emission material
222     MATERIAL_MAP_HEIGHT            ! Heightmap material
223     MATERIAL_MAP_CUBEMAP           ! Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
224     MATERIAL_MAP_IRRADIANCE        ! Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
225     MATERIAL_MAP_PREFILTER         ! Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
226     MATERIAL_MAP_BRDF ;            ! Brdf material
227
228 ALIAS: MATERIAL_MAP_DIFFUSE MATERIAL_MAP_ALBEDO
229 ALIAS: MATERIAL_MAP_SPECULAR MATERIAL_MAP_METALNESS
230
231 ENUM: ShaderLocationIndex
232     SHADER_LOC_VERTEX_POSITION     ! Shader location: vertex attribute: position
233     SHADER_LOC_VERTEX_TEXCOORD01   ! Shader location: vertex attribute: texcoord01
234     SHADER_LOC_VERTEX_TEXCOORD02   ! Shader location: vertex attribute: texcoord02
235     SHADER_LOC_VERTEX_NORMAL       ! Shader location: vertex attribute: normal
236     SHADER_LOC_VERTEX_TANGENT      ! Shader location: vertex attribute: tangent
237     SHADER_LOC_VERTEX_COLOR        ! Shader location: vertex attribute: color
238     SHADER_LOC_MATRIX_MVP          ! Shader location: matrix uniform: model-view-projection
239     SHADER_LOC_MATRIX_VIEW         ! Shader location: matrix uniform: view (camera transform)
240     SHADER_LOC_MATRIX_PROJECTION   ! Shader location: matrix uniform: projection
241     SHADER_LOC_MATRIX_MODEL        ! Shader location: matrix uniform: model (transform)
242     SHADER_LOC_MATRIX_NORMAL       ! Shader location: matrix uniform: normal
243     SHADER_LOC_VECTOR_VIEW         ! Shader location: vector uniform: view
244     SHADER_LOC_COLOR_DIFFUSE       ! Shader location: vector uniform: diffuse color
245     SHADER_LOC_COLOR_SPECULAR      ! Shader location: vector uniform: specular color
246     SHADER_LOC_COLOR_AMBIENT       ! Shader location: vector uniform: ambient color
247     SHADER_LOC_MAP_ALBEDO          ! Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE)
248     SHADER_LOC_MAP_METALNESS       ! Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR)
249     SHADER_LOC_MAP_NORMAL          ! Shader location: sampler2d texture: normal
250     SHADER_LOC_MAP_ROUGHNESS       ! Shader location: sampler2d texture: roughness
251     SHADER_LOC_MAP_OCCLUSION       ! Shader location: sampler2d texture: occlusion
252     SHADER_LOC_MAP_EMISSION        ! Shader location: sampler2d texture: emission
253     SHADER_LOC_MAP_HEIGHT          ! Shader location: sampler2d texture: height
254     SHADER_LOC_MAP_CUBEMAP         ! Shader location: samplerCube texture: cubemap
255     SHADER_LOC_MAP_IRRADIANCE      ! Shader location: samplerCube texture: irradiance
256     SHADER_LOC_MAP_PREFILTER       ! Shader location: samplerCube texture: prefilter
257     SHADER_LOC_MAP_BRDF ;          ! Shader location: sampler2d texture: brdf
258
259 ENUM: ShaderUniformDataType
260     SHADER_UNIFORM_FLOAT           ! Shader uniform type: float
261     SHADER_UNIFORM_VEC2            ! Shader uniform type: vec2 (2 float)
262     SHADER_UNIFORM_VEC3            ! Shader uniform type: vec3 (3 float)
263     SHADER_UNIFORM_VEC4            ! Shader uniform type: vec4 (4 float)
264     SHADER_UNIFORM_INT             ! Shader uniform type: int
265     SHADER_UNIFORM_IVEC2           ! Shader uniform type: ivec2 (2 int)
266     SHADER_UNIFORM_IVEC3           ! Shader uniform type: ivec3 (3 int)
267     SHADER_UNIFORM_IVEC4           ! Shader uniform type: ivec4 (4 int)
268     SHADER_UNIFORM_SAMPLER2D ;     ! Shader uniform type: sampler2d
269
270 ALIAS: SHADER_LOC_MAP_DIFFUSE SHADER_LOC_MAP_ALBEDO
271 ALIAS: SHADER_LOC_MAP_SPECULAR SHADER_LOC_MAP_METALNESS
272
273 ENUM: ShaderAttributeDataType
274     SHADER_ATTRIB_FLOAT            ! Shader attribute type: float
275     SHADER_ATTRIB_VEC2             ! Shader attribute type: vec2 (2 float)
276     SHADER_ATTRIB_VEC3             ! Shader attribute type: vec3 (3 float)
277     SHADER_ATTRIB_VEC4 ;           ! Shader attribute type: vec4 (4 float)
278
279 ! Pixel formats
280 ! NOTE: Support depends on OpenGL version and platform
281 ENUM: PixelFormat
282     { PIXELFORMAT_UNCOMPRESSED_GRAYSCALE 1 } ! 8 bit per pixel (no alpha)
283     PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA      ! 8*2 bpp (2 channels)
284     PIXELFORMAT_UNCOMPRESSED_R5G6B5          ! 16 bpp
285     PIXELFORMAT_UNCOMPRESSED_R8G8B8          ! 24 bpp
286     PIXELFORMAT_UNCOMPRESSED_R5G5B5A1        ! 16 bpp (1 bit alpha)
287     PIXELFORMAT_UNCOMPRESSED_R4G4B4A4        ! 16 bpp (4 bit alpha)
288     PIXELFORMAT_UNCOMPRESSED_R8G8B8A8        ! 32 bpp
289     PIXELFORMAT_UNCOMPRESSED_R32             ! 32 bpp (1 channel - float)
290     PIXELFORMAT_UNCOMPRESSED_R32G32B32       ! 32*3 bpp (3 channels - float)
291     PIXELFORMAT_UNCOMPRESSED_R32G32B32A32    ! 32*4 bpp (4 channels - float)
292     PIXELFORMAT_COMPRESSED_DXT1_RGB          ! 4 bpp (no alpha)
293     PIXELFORMAT_COMPRESSED_DXT1_RGBA         ! 4 bpp (1 bit alpha)
294     PIXELFORMAT_COMPRESSED_DXT3_RGBA         ! 8 bpp
295     PIXELFORMAT_COMPRESSED_DXT5_RGBA         ! 8 bpp
296     PIXELFORMAT_COMPRESSED_ETC1_RGB          ! 4 bpp
297     PIXELFORMAT_COMPRESSED_ETC2_RGB          ! 4 bpp
298     PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA     ! 8 bpp
299     PIXELFORMAT_COMPRESSED_PVRT_RGB          ! 4 bpp
300     PIXELFORMAT_COMPRESSED_PVRT_RGBA         ! 4 bpp
301     PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA     ! 8 bpp
302     PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA ;   ! 2 bpp
303
304 ! Texture parameters: filter mode
305 ! NOTE 1: Filtering considers mipmaps if available in the texture
306 ! NOTE 2: Filter is accordingly set for minification and magnification
307 ENUM: TextureFilterMode
308     TEXTURE_FILTER_POINT                   ! No filter just pixel aproximation
309     TEXTURE_FILTER_BILINEAR                ! Linear filtering
310     TEXTURE_FILTER_TRILINEAR               ! Trilinear filtering (linear with mipmaps)
311     TEXTURE_FILTER_ANISOTROPIC_4X          ! Anisotropic filtering 4x
312     TEXTURE_FILTER_ANISOTROPIC_8X          ! Anisotropic filtering 8x
313     TEXTURE_FILTER_ANISOTROPIC_16X ;       ! Anisotropic filtering 16x
314
315 ! Texture parameters: wrap mode
316 ENUM: TextureWrapMode
317     TEXTURE_WRAP_REPEAT
318     TEXTURE_WRAP_CLAMP
319     TEXTURE_WRAP_MIRROR_REPEAT
320     TEXTURE_WRAP_MIRROR_CLAMP ;
321
322 ! Cubemap layouts
323 ENUM: CubemapLayout
324     CUBEMAP_LAYOUT_AUTO_DETECT             ! Automatically detect layout type
325     CUBEMAP_LAYOUT_LINE_VERTICAL           ! Layout is defined by a vertical line with faces
326     CUBEMAP_LAYOUT_LINE_HORIZONTAL         ! Layout is defined by an horizontal line with faces
327     CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR     ! Layout is defined by a 3x4 cross with cubemap faces
328     CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE     ! Layout is defined by a 4x3 cross with cubemap faces
329     CUBEMAP_LAYOUT_PANORAMA ;              ! Layout is defined by a panorama image (equirectangular map)
330
331 ! Font type, defines generation method
332 ENUM: FontType
333     FONT_DEFAULT               ! Default font generation, anti-aliased
334     FONT_BITMAP                ! Bitmap font generation, no anti-aliasing
335     FONT_SDF ;                 ! SDF font generation, requires external shader
336
337 ! Color blending modes (pre-defined)
338 ENUM: BlendMode
339     BLEND_ALPHA                    ! Blend textures considering alpha (default)
340     BLEND_ADDITIVE                 ! Blend textures adding colors
341     BLEND_MULTIPLIED               ! Blend textures multiplying colors
342     BLEND_ADD_COLORS               ! Blend textures adding colors (alternative)
343     BLEND_SUBTRACT_COLORS          ! Blend textures subtracting colors (alternative)
344     BLEND_CUSTOM ;                 ! Belnd textures using custom src/dst factors (use rlSetBlendMode())
345
346 ! Gestures type
347 ! NOTE: IT could be used as flags to enable only some gestures
348 ENUM: Gestures
349     { GESTURE_NONE          0 }
350     { GESTURE_TAP           1 }
351     { GESTURE_DOUBLETAP     2 }
352     { GESTURE_HOLD          4 }
353     { GESTURE_DRAG          8 }
354     { GESTURE_SWIPE_RIGHT   16 }
355     { GESTURE_SWIPE_LEFT    32 }
356     { GESTURE_SWIPE_UP      64 }
357     { GESTURE_SWIPE_DOWN    128 }
358     { GESTURE_PINCH_IN      256 }
359     { GESTURE_PINCH_OUT     512 } ;
360
361 ! Camera system modes
362 ENUM: CameraMode
363     CAMERA_CUSTOM
364     CAMERA_FREE
365     CAMERA_ORBITAL
366     CAMERA_FIRST_PERSON
367     CAMERA_THIRD_PERSON ;
368
369 ! Camera projection
370 ENUM: CameraProjection
371     CAMERA_PERSPECTIVE
372     CAMERA_ORTHOGRAPHIC ;
373
374 ENUM: NPatchLayout
375     NPATCH_NINE_PATCH               ! Npatch layout: 3x3 tiles
376     NPATCH_THREE_PATCH_VERTICAL     ! Npatch layout: 1x3 tiles
377     NPATCH_THREE_PATCH_HORIZONTAL ; ! Npatch layout: 3x1 tiles
378
379 ! Structs ----------------------------------------------------------------
380
381 STRUCT: Vector2
382     { x float }
383     { y float } ;
384
385 STRUCT: Vector3
386     { x float }
387     { y float }
388     { z float } ;
389
390 STRUCT: Vector4
391     { x float }
392     { y float }
393     { z float }
394     { w float } ;
395
396 TYPEDEF: Vector4 Quaternion ! Same as Vector4
397
398 ERROR: invalid-vector-length obj exemplar ;
399
400 : <Vector2> ( x y -- obj ) Vector2 <struct-boa> ; inline
401 INSTANCE: Vector2 sequence
402 M: Vector2 length drop 2 ; inline
403 M: Vector2 nth-unsafe
404     swap 0 = [ x>> ] [ y>> ] if ;
405 M: Vector2 set-nth-unsafe
406     swap 0 = [ x<< ] [ y<< ] if ;
407 M: Vector2 like
408     over length 2 =
409     [ drop dup Vector2?
410       [ first2 <Vector2> ] unless
411     ] [ invalid-vector-length ] if ; inline
412 M: Vector2 new-sequence
413     over 2 = [
414         2drop Vector2 (struct)
415     ] [ invalid-vector-length ] if ; inline
416
417 : <Vector3> ( x y z -- obj ) Vector3 <struct-boa> ; inline
418 INSTANCE: Vector3 sequence
419 M: Vector3 length drop 3 ; inline
420 M: Vector3 nth-unsafe
421     swap { { 0 [ x>> ] }
422            { 1 [ y>> ] }
423            { 2 [ z>> ] } } case ;
424 M: Vector3 set-nth-unsafe
425     swap { { 0 [ x<< ] }
426            { 1 [ y<< ] }
427            { 2 [ z<< ] } } case ;
428 M: Vector3 like
429     over length 3 =
430     [ drop dup Vector3?
431       [ first3 <Vector3> ] unless
432     ] [ invalid-vector-length ] if ; inline
433 M: Vector3 new-sequence
434     over 3 = [
435         2drop Vector3 (struct)
436     ] [ invalid-vector-length ] if ; inline
437
438 : <Vector4> ( x y z w -- obj ) Vector4 <struct-boa> ; inline
439 INSTANCE: Vector4 sequence
440 M: Vector4 length drop 4 ; inline
441 M: Vector4 nth-unsafe
442     swap { { 0 [ x>> ] }
443            { 1 [ y>> ] }
444            { 2 [ z>> ] }
445            { 3 [ w>> ] } } case ;
446 M: Vector4 set-nth-unsafe
447     swap { { 0 [ x<< ] }
448            { 1 [ y<< ] }
449            { 2 [ z<< ] }
450            { 3 [ w<< ] } } case ;
451 M: Vector4 like
452     over length 4 =
453     [ drop dup Vector4?
454       [ first4 <Vector4> ] unless
455     ] [ invalid-vector-length ] if ; inline
456 M: Vector4 new-sequence
457     over 4 = [
458         2drop Vector4 (struct)
459     ] [ invalid-vector-length ] if ; inline
460
461 ! Matrix type (OpenGL style 4x4 - right handed, column major)
462 STRUCT: Matrix
463     { m0 float } { m4 float } { m8 float } { m12 float }
464     { m1 float } { m5 float } { m9 float } { m13 float }
465     { m2 float } { m6 float } { m10 float } { m14 float }
466     { m3 float } { m7 float } { m11 float } { m15 float } ;
467
468 STRUCT: Color
469     { r uchar }
470     { g uchar }
471     { b uchar }
472     { a uchar } ;
473
474 STRUCT: Rectangle
475     { x float }
476     { y float }
477     { width float }
478     { height float } ;
479
480 ! Image type, bpp always RGBA (32bit)
481 ! NOTE: Data Stored in CPU Memory (RAM)
482 STRUCT: Image
483     { data void* }                     ! Image raw data
484     { width int }                      ! Image base width
485     { height int }                     ! Image base height
486     { mipmaps int }                    ! Mipmap levels, 1 by default
487     { format PixelFormat } ;           ! Data format (PixelFormat type)
488
489 STRUCT: Texture2D
490     { id uint }                        ! OpenGL Texture ID
491     { width int }                      ! Texture Base Width
492     { height int }                     ! Texture Base Height
493     { mipmaps int }                    ! Mipmap Levels, 1 by default
494     { format PixelFormat } ;           ! Data Format (PixelFormat type)
495 TYPEDEF: Texture2D Texture             ! Texture type same as Texture2D
496 TYPEDEF: Texture2D TextureCubemap      ! Actually same as Texture2D
497
498 STRUCT: RenderTexture2D
499     { id uint }                        ! OpenGL Framebuffer Object (FBO) id
500     { texture Texture2D }              ! Color buffer attachment texture
501     { depth Texture2D } ;              ! Depth buffer attachment texture
502
503 TYPEDEF: RenderTexture2D RenderTexture ! Same as RenderTexture2D
504
505 STRUCT: NPatchInfo
506     { source Rectangle }
507     { left int }
508     { top int }
509     { right int }
510     { bottom int }
511     { layout int } ;
512
513 STRUCT: GlyphInfo
514     { value int }                      ! Character value (Unicode)
515     { offsetX int }                    ! Character offset X when drawing
516     { offsetY int }                    ! Character offset Y when drawing
517     { advanceX int }                   ! Character advance position X
518     { image Image } ;                  ! Character image data
519
520 STRUCT: Font
521     { baseSize int }        ! Base Size (default chars height)
522     { glyphCount int }      ! Number of glyph characters
523     { glyphPadding int }    ! Padding around the glyph characters
524     { texture Texture2D }   ! Texture atlas containing the glyphs
525     { recs Rectangle* }     ! Rectangles in texture for the glyphs
526     { glyphs GlyphInfo* } ; ! Glyphs info data
527
528 TYPEDEF: Font SpriteFont
529
530 STRUCT: Camera3D
531     { position Vector3 }  ! Camera postion
532     { target Vector3 }    ! Camera target it looks-at
533     { up Vector3 }        ! Camera up vector (rotation over its axis)
534     { fovy float }        ! Camera field-of-view apperature in Y (degrees) in perspective, used as near plane width in orthographic
535     { projection CameraProjection } ;  ! Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
536
537 STRUCT: Camera2D
538     { offset Vector2 }    ! Camera offset (displacement from target)
539     { target Vector2 }    ! Camera target (rotation and zoom origin)
540     { rotation float }    ! Camera rotation in degrees
541     { zoom float } ;      ! Camera zoom (scaling), should be 1.0f by default
542 TYPEDEF: Camera3D Camera  ! Default to 3D Camera
543
544 STRUCT: Mesh
545     { vertexCount int }    ! Number of vertices stored in arrays
546     { triangleCount int }  ! Number of triangles stored (indexed or not )
547     { _vertices float* }   ! Vertex position (XYZ - 3 components per vertex)
548     { _texcoords float* }  ! Vertex texture coordinates (UV - 2 components per vertex )
549     { _texcoords2 float* } ! Vertex second texture coordinates (useful for lightmaps)
550     { _normals float* }    ! Vertex normals (XYZ - 3 components per vertex)
551     { tangents float* }    ! Vertex tangents (XYZW - 4 components per vertex )
552     { colors uchar* }      ! Vertex colors (RGBA - 4 components per vertex)
553     { indices ushort* }    ! Vertex indices (in case vertex data comes indexed)
554     { animVertices float* }
555     { animNormals float* }
556     { boneIds int* }
557     { boneWeights float* }
558     { vaoId uint }         ! OpenGL Vertex Array Object id
559     { vboId uint* } ;      ! OpenGL Vertex Buffer Objects id (7  types of vertex data)
560
561 ARRAY-SLOT: Mesh Vector3 _vertices [ vertexCount>> ] vertices
562 ARRAY-SLOT: Mesh Vector2 _texcoords [ vertexCount>> ] texcoords
563 ARRAY-SLOT: Mesh Vector2 _texcoords2 [ vertexCount>> ] texcoords2
564 ARRAY-SLOT: Mesh Vector3 _normals [ vertexCount>> ] normals
565
566 STRUCT: Shader
567     { id uint }              ! Shader program id
568     { locs int* } ;          ! Shader locations array
569                              ! This is dependant on MAX_SHADER_LOCATIONS.  Default is 32
570 STRUCT: MaterialMap
571     { texture Texture2D }    ! Material map Texture
572     { color Color }          ! Material map color
573     { value float } ;        ! Material map value
574
575 CONSTANT: MAX_MATERIAL_MAPS 12 ! NOTE: This seems to be a compile-time constant!
576 STRUCT: Material
577     { shader Shader }        ! Material shader
578     { _maps MaterialMap* }   ! Material maps.  Uses MAX_MATERIAL_MAPS.
579     { params float[4] } ;    ! Material generic parameters (if required)
580
581 ARRAY-SLOT: Material MaterialMap _maps [ drop 12 ] maps
582
583 STRUCT: Transform
584     { translation Vector3 }
585     { rotation Quaternion }
586     { scale Vector3 } ;
587
588 STRUCT: BoneInfo
589     { name char[32] }        ! Bone Name
590     { parent int } ;         ! Bone parent
591
592 STRUCT: Model
593     { transform Matrix }
594     { meshCount int }
595     { materialCount int }
596     { _meshes Mesh* }
597     { _materials Material* }
598     { meshMaterial int* }
599     { boneCount int }
600     { _bones BoneInfo* }
601     { bindPose Transform* } ;
602
603 ARRAY-SLOT: Model Material _materials [ materialCount>> ] materials
604 ARRAY-SLOT: Model Mesh _meshes [ meshCount>> ] meshes
605 ARRAY-SLOT: Model BoneInfo _bones [ boneCount>> ] bones
606
607 STRUCT: ModelAnimation
608     { boneCount int }
609     { frameCount int }
610     { _bones BoneInfo* }
611     { framePoses Transform** } ;
612
613 ARRAY-SLOT: ModelAnimation BoneInfo _bones [ boneCount>> ] bones
614
615 STRUCT: Ray
616     { position Vector3 }    ! Ray position (origin)
617     { direction Vector3 } ; ! Ray direction
618
619 STRUCT: RayCollision
620     { hit bool }            ! Did the ray hit something?
621     { distance float }      ! Distance to nearest hit
622     { point Vector3 }       ! Point of nearest hit
623     { normal Vector3 } ;    ! Surface normal of hit
624
625 STRUCT: BoundingBox
626     { min Vector3 }       ! Minimum vertex box-corner
627     { max Vector3 } ;     ! Maximum vertex box-corner
628
629 STRUCT: Wave
630     { frameCount uint }     ! Total number of frames (considering channels)
631     { sampleRate uint }     ! Frequency (samples per second)
632     { sampleSize uint }     ! Bit depth (bits per sample): 8,16,32
633     { channels uint }       ! Number of channels (1-mono, 2-stereo)
634     { data void* } ;        ! Buffer data pointer
635
636 STRUCT: AudioStream
637     { buffer void* }    ! Pointer to internal data used by the audio system
638     { sampleRate uint } ! Frequency (samples per second)
639     { sampleSize uint } ! Bit depth (bits per sample): 8, 16, 32 (24 not supported)
640     { channels uint } ; ! Number of channels (1-mono, 2-stereo)
641
642 STRUCT: Sound
643     { stream AudioStream } ! Audio stream
644     { frameCount uint } ;  ! Total number of frames (considering channels)
645
646 STRUCT: Music
647     { stream  AudioStream }     ! Audio stream
648     { frameCount uint }         ! Total number of frames (considering channels)
649     { looping bool }            ! Music looping enable
650     { ctxType int }             ! Type of music context (audio filetype)
651     { ctxData void* } ;         ! Audio context data, depends on type
652
653 STRUCT: VrDeviceInfo
654     { hResolution int }               ! HMD horizontal resolution in pixels
655     { vResolution int }               ! HMD verticle resolution in pixels
656     { hScreenSize float }             ! HMD horizontal size in meters
657     { vScreenSize float }             ! HMD verticle size in meters
658     { vScreenCenter float }           ! HMD screen center in meters
659     { eyeToScreenDistance float }     ! HMD distance between eye and display in meters
660     { lensSeparationDistance float }  ! HMD lens separation distance in meters
661     { interpupillaryDistance float }  ! HMD IPD in meters
662     { lensDistortionValues float[4] } ! HMD lens distortion constant parameters
663     { chromaAbCorrection float[4] } ; ! HMD chromatic abberation correction parameters
664
665 STRUCT: VrStereoConfig
666     { projection Matrix[2] }          ! VR projection matrices (per eye)
667     { viewOffset Matrix[2] }          ! VR view offset matrices (per eye)
668     { leftLensCenter float[2] }       ! VR left lens center
669     { rightLensCenter float[2] }      ! VR right lens center
670     { leftScreenCenter float[2] }     ! VR left screen center
671     { rightScreenCenter float[2] }    ! VR right screen center
672     { scale float[2] }                ! VR distortion scale
673     { scaleIn float[2] } ;            ! VR distortion scale in
674
675 ! Constants ----------------------------------------------------------------
676
677 CONSTANT: LIGHTGRAY  S{ Color f 200  200  200  255  } ! Light Gray
678 CONSTANT: GRAY       S{ Color f 130  130  130  255  } ! Gray
679 CONSTANT: DARKGRAY   S{ Color f 80  80  80  255     } ! Dark Gray
680 CONSTANT: YELLOW     S{ Color f 253  249  0  255    } ! Yellow
681 CONSTANT: GOLD       S{ Color f 255  203  0  255    } ! Gold
682 CONSTANT: ORANGE     S{ Color f 255  161  0  255    } ! Orange
683 CONSTANT: PINK       S{ Color f 255  109  194  255  } ! Pink
684 CONSTANT: RED        S{ Color f 230  41  55  255    } ! Red
685 CONSTANT: MAROON     S{ Color f 190  33  55  255    } ! Maroon
686 CONSTANT: GREEN      S{ Color f 0  228  48  255     } ! Green
687 CONSTANT: LIME       S{ Color f 0  158  47  255     } ! Lime
688 CONSTANT: DARKGREEN  S{ Color f 0  117  44  255     } ! Dark Green
689 CONSTANT: SKYBLUE    S{ Color f 102  191  255  255  } ! Sky Blue
690 CONSTANT: BLUE       S{ Color f 0  121  241  255    } ! Blue
691 CONSTANT: DARKBLUE   S{ Color f 0  82  172  255     } ! Dark Blue
692 CONSTANT: PURPLE     S{ Color f 200  122  255  255  } ! Purple
693 CONSTANT: VIOLET     S{ Color f 135  60  190  255   } ! Violet
694 CONSTANT: DARKPURPLE S{ Color f 112  31  126  255   } ! Dark Purple
695 CONSTANT: BEIGE      S{ Color f 211  176  131  255  } ! Beige
696 CONSTANT: BROWN      S{ Color f 127  106  79  255   } ! Brown
697 CONSTANT: DARKBROWN  S{ Color f 76  63  47  255     } ! Dark Brown
698
699 CONSTANT: WHITE      S{ Color f 255  255  255  255  } ! White
700 CONSTANT: BLACK      S{ Color f 0  0  0  255        } ! Black
701 CONSTANT: BLANK      S{ Color f 0  0  0  0          } ! Blank (Transparent)
702 CONSTANT: MAGENTA    S{ Color f 255  0  255  255    } ! Magenta
703 CONSTANT: RAYWHITE   S{ Color f 245  245  245  255  } ! My own White (raylib logo)
704
705 ! Functions ---------------------------------------------------------------
706
707 ! Window-related functions
708 FUNCTION-ALIAS: init-window void InitWindow ( int width, int height, c-string title )    ! Initialize window and OpenGL context
709 FUNCTION-ALIAS: window-should-close bool WindowShouldClose ( )                           ! Check if KEY_ESCAPE pressed or Close icon pressed
710 FUNCTION-ALIAS: close-window void CloseWindow ( )                                        ! Close window and unload OpenGL context
711 FUNCTION-ALIAS: is-window-ready bool IsWindowReady ( )                                   ! Check if window has been initialized successfully
712 FUNCTION-ALIAS: is-window-fullscreen bool IsWindowFullscreen ( )                         ! Check if window is currently fullscreen
713 FUNCTION-ALIAS: is-window-hidden bool IsWindowHidden ( )                                 ! Check if window is currently hidden (only PLATFORM_DESKTOP)
714 FUNCTION-ALIAS: is-window-minimized bool IsWindowMinimized ( )                           ! Check if window is currently minimized (only PLATFORM_DESKTOP)
715 FUNCTION-ALIAS: is-window-maximized bool IsWindowMaximized ( )                           ! Check if window is currently maximized (only PLATFORM_DESKTOP)
716 FUNCTION-ALIAS: is-window-focused bool IsWindowFocused ( )                               ! Check if window is currently focused (only PLATFORM_DESKTOP)
717 FUNCTION-ALIAS: is-window-resized bool IsWindowResized ( )                               ! Check if window has been resized last frame
718 FUNCTION-ALIAS: is-window-state bool IsWindowState ( uint flag )                         ! Check if one specific window flag is enabled
719 FUNCTION-ALIAS: set-window-state void SetWindowState ( uint flags )                      ! Set window configuration state using flags
720 FUNCTION-ALIAS: clear-window-state void ClearWindowState ( uint flags )                  ! Clear window configuration state flags
721 FUNCTION-ALIAS: toggle-fullscreen void ToggleFullscreen ( )                              ! Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
722 FUNCTION-ALIAS: maximize-window void MaximizeWindow ( )                                  ! Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
723 FUNCTION-ALIAS: minimize-window void MinimizeWindow ( )                                  ! Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
724 FUNCTION-ALIAS: restore-window void RestoreWindow ( )                                    ! Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
725 FUNCTION-ALIAS: set-window-icon void SetWindowIcon ( Image image )                       ! Set icon for window (only PLATFORM_DESKTOP)
726 FUNCTION-ALIAS: set-window-title void SetWindowTitle ( c-string title )                  ! Set title for window (only PLATFORM_DESKTOP)
727 FUNCTION-ALIAS: set-window-position void SetWindowPosition ( int x, int y )              ! Set window position on screen (only PLATFORM_DESKTOP)
728 FUNCTION-ALIAS: set-window-monitor void SetWindowMonitor ( int monitor )                 ! Set monitor for the current window (fullscreen mode)
729 FUNCTION-ALIAS: set-window-min-size void SetWindowMinSize ( int width, int height )      ! Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
730 FUNCTION-ALIAS: set-window-size void SetWindowSize ( int width, int height )             ! Set window dimensions
731 FUNCTION-ALIAS: get-window-handle void* GetWindowHandle ( )                              ! Get native window handle
732 FUNCTION-ALIAS: get-screen-width int GetScreenWidth ( )                                  ! Get current screen width
733 FUNCTION-ALIAS: get-screen-height int GetScreenHeight ( )                                ! Get current screen height
734 FUNCTION-ALIAS: get-render-width int GetRenderWidth ( )                                  ! Get current render width (it considers HiDPI)
735 FUNCTION-ALIAS: get-render-height int GetRenderHeight ( )                                ! Get current render height (it considers HiDPI)
736 FUNCTION-ALIAS: get-monitor-count int GetMonitorCount ( )                                ! Get number of connected monitors
737 FUNCTION-ALIAS: get-current-monitor int GetCurrentMonitor ( )                            ! Get current connected monitor
738 FUNCTION-ALIAS: get-monitor-position Vector2 GetMonitorPosition ( int monitor )          ! Get specified monitor position
739 FUNCTION-ALIAS: get-monitor-width int GetMonitorWidth ( int monitor )                    ! Get specified monitor width (max available by monitor)
740 FUNCTION-ALIAS: get-monitor-height int GetMonitorHeight ( int monitor )                  ! Get specified monitor height (max available by monitor)
741 FUNCTION-ALIAS: get-monitor-physical-width int GetMonitorPhysicalWidth ( int monitor )   ! Get specified monitor physical width in millimetres
742 FUNCTION-ALIAS: get-monitor-physical-height int GetMonitorPhysicalHeight ( int monitor ) ! Get specified monitor physical height in millimetres
743 FUNCTION-ALIAS: get-monitor-refresh-rate int GetMonitorRefreshRate ( int monitor )       ! Get specified monitor refresh rate
744 FUNCTION-ALIAS: get-window-position Vector2 GetWindowPosition ( )                        ! Get window position XY on monitor
745 FUNCTION-ALIAS: get-window-scale-dpi Vector2 GetWindowScaleDPI ( )                       ! Get window scale DPI factor
746 FUNCTION-ALIAS: get-monitor-name c-string GetMonitorName ( int monitor )                 ! Get the human-readable, UTF-8 encoded name of the primary monitor
747 FUNCTION-ALIAS: set-clipboard-text void SetClipboardText ( c-string text )               ! Set clipboard text content
748 FUNCTION-ALIAS: get-clipboard-text c-string GetClipboardText ( )                         ! Get clipboard text content
749
750 ! Custom frame control functions
751 ! NOTE: Those functions are intended for advance users that want full control over the frame processing
752 ! By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
753 ! To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
754 FUNCTION-ALIAS: swap-screen-buffer void SwapScreenBuffer ( )                             ! Swap back buffer with front buffer (screen drawing)
755 FUNCTION-ALIAS: poll-input-events void PollInputEvents ( )                               ! Register all input events
756 FUNCTION-ALIAS: wait-time void WaitTime ( float ms )                                     ! Wait for some milliseconds (halt program execution)
757
758 ! Cursor-related functions
759 FUNCTION-ALIAS: show-cursor void ShowCursor ( )                                          ! Shows cursor
760 FUNCTION-ALIAS: hide-cursor void HideCursor ( )                                          ! Hides cursor
761 FUNCTION-ALIAS: is-cursor-hidden bool IsCursorHidden ( )                                 ! Check if cursor is not visible
762 FUNCTION-ALIAS: enable-cursor void EnableCursor ( )                                      ! Enables cursor (unlock cursor)
763 FUNCTION-ALIAS: disable-cursor void DisableCursor ( )                                    ! Disables cursor (lock cursor)
764 FUNCTION-ALIAS: is-cursor-on-screen bool IsCursorOnScreen ( )                            ! Check if cursor is on the screen
765
766 ! Drawing-related functions
767 FUNCTION-ALIAS: clear-background void ClearBackground ( Color color )                    ! Set background color (framebuffer clear color)
768 FUNCTION-ALIAS: begin-drawing void BeginDrawing ( )                                      ! Setup canvas (framebuffer) to start drawing
769 FUNCTION-ALIAS: end-drawing void EndDrawing ( )                                          ! End canvas drawing and swap buffers (double buffering)
770 FUNCTION-ALIAS: begin-mode-2d void BeginMode2D ( Camera2D camera )                       ! Begin 2D mode with custom camera (2D)
771 FUNCTION-ALIAS: end-mode-2d void EndMode2D ( )                                           ! Ends 2D mode with custom camera
772 FUNCTION-ALIAS: begin-mode-3d void BeginMode3D ( Camera3D camera )                       ! Begin 3D mode with custom camera (3D)
773 FUNCTION-ALIAS: end-mode-3d void EndMode3D ( )                                           ! Ends 3D mode and returns to default 2D orthographic mode
774 FUNCTION-ALIAS: begin-texture-mode void BeginTextureMode ( RenderTexture2D target )      ! Begin drawing to render texture
775 FUNCTION-ALIAS: end-texture-mode void EndTextureMode ( )                                 ! Ends drawing to render texture
776 FUNCTION-ALIAS: begin-shader-mode void BeginShaderMode ( Shader shader )                 ! Begin custom shader drawing
777 FUNCTION-ALIAS: end-shader-mode void EndShaderMode ( )                                   ! End custom shader drawing (use default shader)
778 FUNCTION-ALIAS: begin-blend-mode void BeginBlendMode ( BlendMode mode )                  ! Begin blending mode (alpha, additive, multiplied, subtract, custom)
779 FUNCTION-ALIAS: end-blend-mode void EndBlendMode ( )                                     ! End blending mode (reset to default: alpha blending)
780 FUNCTION-ALIAS: begin-scissor-mode void BeginScissorMode ( int x, int y, int width, int height ) ! Begin scissor mode (define screen area for following drawing)
781 FUNCTION-ALIAS: end-scissor-mode void EndScissorMode ( )                                 ! End scissor mode
782 FUNCTION-ALIAS: begin-vr-stereo-mode void BeginVrStereoMode ( VrStereoConfig config )    ! Begin stereo rendering (requires VR simulator)
783 FUNCTION-ALIAS: end-vr-stereo-mode void EndVrStereoMode ( )                              ! End stereo rendering (requires VR simulator)
784
785 ! VR stereo config functions for VR simulator
786 FUNCTION-ALIAS: load-vr-stereo-config VrStereoConfig LoadVrStereoConfig ( VrDeviceInfo device ) ! Load VR stereo config for VR simulator device parameters
787 FUNCTION-ALIAS: unload-vr-stereo-config void UnloadVrStereoConfig ( VrStereoConfig config )     ! Unload VR stereo config
788
789 ! Shader management functions
790 ! NOTE: Shader functionality is not available on OpenGL 1.1
791 FUNCTION-ALIAS: load-shader Shader LoadShader ( c-string vsFileName, c-string fsFileName )                                       ! Load shader from files and bind default locations
792 FUNCTION-ALIAS: load-shader-from-memory Shader LoadShaderFromMemory ( c-string vsCode, c-string fsCode )                         ! Load shader from code strings and bind default locations
793 FUNCTION-ALIAS: get-shader-location int GetShaderLocation ( Shader shader, c-string uniformName )                                ! Get shader uniform location
794 FUNCTION-ALIAS: get-shader-location-attrib int GetShaderLocationAttrib ( Shader shader, c-string attribName )                    ! Get shader attribute location
795 FUNCTION-ALIAS: set-shader-value void SetShaderValue ( Shader shader, int locIndex, void* value, ShaderUniformDataType uniformType ) ! Set shader uniform value
796 FUNCTION-ALIAS: set-shader-value-v void SetShaderValueV ( Shader shader, int locIndex, void* value, ShaderUniformDataType uniformType, int count ) ! Set shader uniform value vector
797 FUNCTION-ALIAS: set-shader-value-matrix void SetShaderValueMatrix ( Shader shader, int locIndex, Matrix mat )                    ! Set shader uniform value (matrix 4x4)
798 FUNCTION-ALIAS: set-shader-value-texture void SetShaderValueTexture ( Shader shader, int locIndex, Texture2D texture )           ! Set shader uniform value for texture (sampler2d)
799 FUNCTION-ALIAS: unload-shader void UnloadShader ( Shader shader )                                                                ! Unload shader from GPU memory (VRAM)
800
801 ! Screen-space-related functions
802 FUNCTION-ALIAS: get-mouse-ray Ray GetMouseRay ( Vector2 mousePosition, Camera camera )                                        ! Get a ray trace from mouse position
803 FUNCTION-ALIAS: get-camera-matrix Matrix GetCameraMatrix ( Camera camera )                                                    ! Get camera transform matrix (view matrix)
804 FUNCTION-ALIAS: get-camera-matrix-2d Matrix GetCameraMatrix2D ( Camera2D camera )                                             ! Get camera 2d transform matrix
805 FUNCTION-ALIAS: get-world-to-screen Vector2 GetWorldToScreen ( Vector3 position, Camera camera )                              ! Get the screen space position for a 3d world space position
806 FUNCTION-ALIAS: get-world-to-screen-ex Vector2 GetWorldToScreenEx ( Vector3 position, Camera camera, int width, int height )  ! Get size position for a 3d world space position
807 FUNCTION-ALIAS: get-world-to-screen-2d Vector2 GetWorldToScreen2D ( Vector2 position, Camera2D camera )                       ! Get the screen space position for a 2d camera world space position
808 FUNCTION-ALIAS: get-screen-to-world-2d Vector2 GetScreenToWorld2D ( Vector2 position, Camera2D camera )                       ! Get the world space position for a 2d camera screen space position
809
810 ! Timing-related functions
811 FUNCTION-ALIAS: set-target-fps void SetTargetFPS ( int fps )                             ! Set target FPS (maximum)
812 FUNCTION-ALIAS: get-fps int GetFPS ( )                                                   ! Get current FPS
813 FUNCTION-ALIAS: get-frame-time float GetFrameTime ( )                                    ! Get time in seconds for last frame drawn (delta time)
814 FUNCTION-ALIAS: get-time double GetTime ( )                                              ! Get elapsed time in seconds since InitWindow()
815
816 ! Misc. functions
817 FUNCTION-ALIAS: get-random-value int GetRandomValue  ( int min, int max )                ! Get a random value between min and max (both included)
818 FUNCTION-ALIAS: set-random-seed void SetRandomSeed ( uint seed )                         ! Set the seed for the random number generator
819 FUNCTION-ALIAS: take-screenshot void TakeScreenshot ( c-string  fileName )               ! Takes a screenshot of current screen (filename extension defines format)
820 FUNCTION-ALIAS: set-config-flags void SetConfigFlags ( uint flags )                      ! Setup init configuration flags (view FLAGS)
821
822 ! FUNCTION: void TraceLog  ( int logLevel, c-string text, ... )                            ! Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
823 FUNCTION-ALIAS: set-trace-log-level void SetTraceLogLevel ( int logLevel )               ! Set the current threshold (minimum) log level
824 FUNCTION-ALIAS: mem-alloc void* MemAlloc ( int size )                                    ! Internal memory allocator
825 FUNCTION-ALIAS: mem-realloc void* MemRealloc ( void* ptr, int size )                     ! Internal memory reallocator
826 FUNCTION-ALIAS: mem-free void MemFree ( void* ptr )                                      ! Internal memory free
827
828 ! Set custom callbacks
829 ! WARNING: Callbacks setup is intended for advance users
830 ! FUNCTION: void SetTraceLogCallback ( TraceLogCallback callback )          ! Set custom trace log
831 ! FUNCTION: void SetLoadFileDataCallback ( LoadFileDataCallback callback )  ! Set custom file binary data loader
832 ! FUNCTION: void SetSaveFileDataCallback ( SaveFileDataCallback callback )  ! Set custom file binary data saver
833 ! FUNCTION: void SetLoadFileTextCallback ( LoadFileTextCallback callback )  ! Set custom file text data loader
834 ! FUNCTION: void SetSaveFileTextCallback ( SaveFileTextCallback callback )  ! Set custom file text data saver
835
836 ! Files management functions
837 FUNCTION-ALIAS: load-file-data c-string LoadFileData ( c-string fileName, uint* bytesRead )           ! Load file data as byte array (read)
838 FUNCTION-ALIAS: unload-file-data void UnloadFileData ( c-string data )                                ! Unload file data allocated by LoadFileData()
839 FUNCTION-ALIAS: save-file-data bool SaveFileData ( c-string fileName, void* data, uint bytesToWrite ) ! Save data to file from byte array (write), returns true on success
840 FUNCTION-ALIAS: load-file-text c-string LoadFileText ( c-string fileName )                            ! Load text data from file (read), returns a '\0' terminated string
841 FUNCTION-ALIAS: unload-file-text void UnloadFileText ( c-string text )                                ! Unload file text data allocated by LoadFileText()
842 FUNCTION-ALIAS: save-file-text bool SaveFileText ( c-string fileName, c-string text )                 ! Save text data to file (write), string must be '\0' terminated, returns true on success
843 FUNCTION-ALIAS: file-exists bool FileExists ( c-string fileName )                                     ! Check if file exists
844 FUNCTION-ALIAS: directory-exists bool DirectoryExists ( c-string dirPath )                            ! Check if a directory path exists
845 FUNCTION-ALIAS: is-file-extension bool IsFileExtension ( c-string fileName, c-string ext )            ! Check file extension (including point: .png, .wav)
846 FUNCTION-ALIAS: get-file-extension c-string GetFileExtension ( c-string fileName )                    ! Get pointer to extension for a filename string (includes dot: '.png')
847 FUNCTION-ALIAS: get-file-name c-string GetFileName ( c-string filePath )                              ! Get pointer to filename for a path string
848 FUNCTION-ALIAS: get-file-name-without-ext c-string GetFileNameWithoutExt ( c-string filePath )        ! Get filename string without extension (uses static string)
849 FUNCTION-ALIAS: get-directory-path c-string GetDirectoryPath ( c-string filePath )                    ! Get full path for a given fileName with path (uses static string)
850 FUNCTION-ALIAS: get-prev-directory-path c-string GetPrevDirectoryPath ( c-string dirPath )            ! Get previous directory path for a given path (uses static string)
851 FUNCTION-ALIAS: get-working-directory c-string GetWorkingDirectory ( )                                ! Get current working directory (uses static string)
852 FUNCTION-ALIAS: get-directory-files char** GetDirectoryFiles ( c-string dirPath, int* count )         ! Get filenames in a directory path (memory should be freed)
853 FUNCTION-ALIAS: clear-directory-files void ClearDirectoryFiles ( )                                    ! Clear directory files paths buffers (free memory)
854 FUNCTION-ALIAS: change-directory bool ChangeDirectory ( c-string dir )                                ! Change working directory, return true on success
855 FUNCTION-ALIAS: is-file-dropped bool IsFileDropped ( )                                                ! Check if a file has been dropped into window
856 FUNCTION-ALIAS: get-dropped-files c-string* GetDroppedFiles ( int* count )                            ! Get dropped files names (memory should be freed)
857 FUNCTION-ALIAS: clear-dropped-files void ClearDroppedFiles ( )                                        ! Clear dropped files paths buffer (free memory)
858 FUNCTION-ALIAS: get-file-mod-time long GetFileModTime ( c-string fileName )                           ! Get file modification time (last write time)
859
860 ! Compression/Encoding functionality
861 FUNCTION-ALIAS: compress-data uchar* CompressData ( uchar* data, int dataLength, int* compDataLength )         ! Compress data (DEFLATE algorithm)
862 FUNCTION-ALIAS: decompress-data uchar* DecompressData ( uchar* compData, int compDataLength, int* dataLength ) ! Decompress data (DEFLATE algorithm)
863 FUNCTION-ALIAS: encode-data-base64 uchar* EncodeDataBase64 ( uchar* data, int dataLength, int* outputLength )  ! Encode data to Base64 string
864 FUNCTION-ALIAS: decode-data-base64 uchar* DecodeDataBase64 ( uchar* data, int* outputLength )                  ! Decode Base64 string data
865
866 ! Persistent storage management
867 FUNCTION-ALIAS: save-storage-value bool SaveStorageValue ( uint position, int value )    ! Save integer value to storage file (to defined position), returns true on success
868 FUNCTION-ALIAS: load-storage-value int LoadStorageValue ( uint position )                ! Load integer value from storage file (from defined position)
869
870 FUNCTION-ALIAS: open-url void OpenURL ( c-string url )                                   ! Open URL with default system browser (if available)
871
872 ! ------------------------------------------------------------------------------------
873 ! Input Handling Functions (Module: core)
874 ! ------------------------------------------------------------------------------------
875
876 ! Input-related functions: keyboard
877 FUNCTION-ALIAS: is-key-pressed bool IsKeyPressed ( KeyboardKey key )                     ! Check if a key has been pressed once
878 FUNCTION-ALIAS: is-key-down bool IsKeyDown ( KeyboardKey key )                           ! Check if a key is being pressed
879 FUNCTION-ALIAS: is-key-released bool IsKeyReleased ( KeyboardKey key )                   ! Check if a key has been released once
880 FUNCTION-ALIAS: is-key-up bool IsKeyUp ( KeyboardKey key )                               ! Check if a key is NOT being pressed
881 FUNCTION-ALIAS: set-exit-key void SetExitKey ( KeyboardKey key )                         ! Set a custom key to exit program (default is ESC)
882 FUNCTION-ALIAS: get-key-pressed KeyboardKey GetKeyPressed ( )                            ! Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
883 FUNCTION-ALIAS: get-char-pressed int GetCharPressed ( )                                  ! Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
884
885 ! Input-related functions: gamepads
886 FUNCTION-ALIAS: is-gamepad-available bool IsGamepadAvailable ( int gamepad )                                  ! Check if a gamepad is available
887 FUNCTION-ALIAS: get-gamepad-name c-string GetGamepadName ( int gamepad )                                      ! Get gamepad internal name id
888 FUNCTION-ALIAS: is-gamepad-button-pressed bool IsGamepadButtonPressed ( int gamepad, GamepadButton button )   ! Check if a gamepad button has been pressed once
889 FUNCTION-ALIAS: is-gamepad-button-down bool IsGamepadButtonDown ( int gamepad, GamepadButton button )         ! Check if a gamepad button is being pressed
890 FUNCTION-ALIAS: is-gamepad-button-released bool IsGamepadButtonReleased ( int gamepad, GamepadButton button ) ! Check if a gamepad button has been released once
891 FUNCTION-ALIAS: is-gamepad-button-up bool IsGamepadButtonUp ( int gamepad, GamepadButton button )             ! Check if a gamepad button is NOT being pressed
892 FUNCTION-ALIAS: get-gamepad-button-pressed int GetGamepadButtonPressed ( )                                    ! Get the last gamepad button pressed
893 FUNCTION-ALIAS: get-gamepad-axis-count int GetGamepadAxisCount ( int gamepad )                                ! Get gamepad axis count for a gamepad
894 FUNCTION-ALIAS: get-gamepad-axis-movement float GetGamepadAxisMovement ( int gamepad, GamepadAxis axis )      ! Get axis movement value for a gamepad axis
895 FUNCTION-ALIAS: set-gamepad-mappings int SetGamepadMappings ( c-string mappings )                             ! Set internal gamepad mappings (SDL_GameControllerDB)
896
897 ! Input-related functions: mouse
898 FUNCTION-ALIAS: is-mouse-button-pressed bool IsMouseButtonPressed ( MouseButton button )   ! Check if a mouse button has been pressed once
899 FUNCTION-ALIAS: is-mouse-button-down bool IsMouseButtonDown ( MouseButton button )         ! Check if a mouse button is being pressed
900 FUNCTION-ALIAS: is-mouse-button-released bool IsMouseButtonReleased ( MouseButton button ) ! Check if a mouse button has been released once
901 FUNCTION-ALIAS: is-mouse-button-up bool IsMouseButtonUp ( MouseButton button )             ! Check if a mouse button is NOT being pressed
902 FUNCTION-ALIAS: get-mouse-x int GetMouseX ( )                                              ! Get mouse position X
903 FUNCTION-ALIAS: get-mouse-y int GetMouseY ( )                                              ! Get mouse position Y
904 FUNCTION-ALIAS: get-mouse-position Vector2 GetMousePosition ( )                            ! Get mouse position XY
905 FUNCTION-ALIAS: get-mouse-delta Vector2 GetMouseDelta ( )                                  ! Get mouse delta between frames
906 FUNCTION-ALIAS: set-mouse-position void SetMousePosition ( int x, int y )                  ! Set mouse position XY
907 FUNCTION-ALIAS: set-mouse-offset void SetMouseOffset ( int offsetX, int offsetY )          ! Set mouse offset
908 FUNCTION-ALIAS: set-mouse-scale void SetMouseScale ( float scaleX, float scaleY )          ! Set mouse scaling
909 FUNCTION-ALIAS: get-mouse-wheel-move float GetMouseWheelMove ( )                           ! Get mouse wheel movement Y
910 FUNCTION-ALIAS: set-mouse-cursor void SetMouseCursor ( MouseCursor cursor )                ! Set mouse cursor
911
912 ! Input-related functions: touch
913 FUNCTION-ALIAS: get-touch-x int GetTouchX ( )                                            ! Get touch position X for touch point 0 (relative to screen size)
914 FUNCTION-ALIAS: get-touch-y int GetTouchY ( )                                            ! Get touch position Y for touch point 0 (relative to screen size)
915 FUNCTION-ALIAS: get-touch-position Vector2 GetTouchPosition ( int index )                ! Get touch position XY for a touch point index (relative to screen size)
916 FUNCTION-ALIAS: get-touch-point-id int GetTouchPointId ( int index )                     ! Get touch point identifier for given index
917 FUNCTION-ALIAS: get-touch-point-count int GetTouchPointCount ( )                         ! Get number of touch points
918
919 ! ------------------------------------------------------------------------------------
920 ! Gestures and Touch Handling Functions (Module: rgestures)
921 ! ------------------------------------------------------------------------------------
922 FUNCTION-ALIAS: set-gestures-enabled void SetGesturesEnabled ( uint flags )              ! Enable a set of gestures using flags
923 FUNCTION-ALIAS: is-gesture-detected bool IsGestureDetected ( Gestures gesture )          ! Check if a gesture have been detected
924 FUNCTION-ALIAS: get-gesture-detected int GetGestureDetected ( )                          ! Get latest detected gesture
925 FUNCTION-ALIAS: get-gesture-hold-duration float GetGestureHoldDuration ( )               ! Get gesture hold time in milliseconds
926 FUNCTION-ALIAS: get-gesture-drag-vector Vector2 GetGestureDragVector ( )                 ! Get gesture drag vector
927 FUNCTION-ALIAS: get-gesture-drag-angle float GetGestureDragAngle ( )                     ! Get gesture drag angle
928 FUNCTION-ALIAS: get-gesture-pinch-vector Vector2 GetGesturePinchVector ( )               ! Get gesture pinch delta
929 FUNCTION-ALIAS: get-gesture-pinch-angle float GetGesturePinchAngle ( )                   ! Get gesture pinch angle
930
931 ! ------------------------------------------------------------------------------------
932 ! Camera System Functions (Module: rcamera)
933 ! ------------------------------------------------------------------------------------
934 FUNCTION-ALIAS: set-camera-mode void SetCameraMode ( Camera camera, CameraMode mode )    ! Set camera mode (multiple camera modes available)
935 FUNCTION-ALIAS: update-camera void UpdateCamera ( Camera* camera )                       ! Update camera position for selected mode
936
937 FUNCTION-ALIAS: set-camera-pan-control void SetCameraPanControl ( int keyPan )           ! Set camera pan key to combine with mouse movement (free camera)
938 FUNCTION-ALIAS: set-camera-alt-control void SetCameraAltControl ( int keyAlt )           ! Set camera alt key to combine with mouse movement (free camera)
939 FUNCTION-ALIAS: set-camera-smooth-zoom-control void SetCameraSmoothZoomControl ( int keySmoothZoom ) ! Set camera smooth zoom key to combine with mouse (free camera)
940 FUNCTION-ALIAS: set-camera-move-controls void SetCameraMoveControls ( int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown ) ! Set camera move controls (1st person and 3rd person cameras)
941
942 ! ------------------------------------------------------------------------------------
943 ! Basic Shapes Drawing Functions (Module: shapes)
944 ! ------------------------------------------------------------------------------------
945 ! Set texture and rectangle to be used on shapes drawing
946 ! NOTE: It can be useful when using basic shapes and one single font,
947 ! defining a font char white rectangle would allow drawing everything in a single draw call
948 FUNCTION-ALIAS: set-shapes-texture void SetShapesTexture ( Texture2D texture, Rectangle source ) ! Set texture and rectangle to be used on shapes drawing
949
950 ! Basic shapes drawing functions
951 FUNCTION-ALIAS: draw-pixel void DrawPixel ( int posX, int posY, Color color )                                                    ! Draw a pixel
952 FUNCTION-ALIAS: draw-pixel-v void DrawPixelV ( Vector2 position, Color color )                                                   ! Draw a pixel (Vector version)
953 FUNCTION-ALIAS: draw-line void DrawLine ( int startPosX, int startPosY, int endPosX, int endPosY, Color color )                  ! Draw a line
954 FUNCTION-ALIAS: draw-line-v void DrawLineV ( Vector2 startPos, Vector2 endPos, Color color )                                     ! Draw a line (Vector version)
955 FUNCTION-ALIAS: draw-line-ex void DrawLineEx ( Vector2 startPos, Vector2 endPos, float thick, Color color )                      ! Draw a line defining thickness
956 FUNCTION-ALIAS: draw-line-bezier void DrawLineBezier ( Vector2 startPos, Vector2 endPos, float thick, Color color )              ! Draw a line using cubic-bezier curves in-out
957 FUNCTION-ALIAS: draw-line-bezier-quad void DrawLineBezierQuad ( Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color )  ! Draw line using quadratic bezier curves with a control point
958 FUNCTION-ALIAS: draw-line-bezier-cubic void DrawLineBezierCubic ( Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color )  ! Draw line using cubic bezier curves with 2 control points
959 FUNCTION-ALIAS: draw-line-strip void DrawLineStrip ( Vector2* points, int pointCount, Color color )                              ! Draw lines sequence
960 FUNCTION-ALIAS: draw-circle void DrawCircle ( int centerX, int centerY, float radius, Color color )                              ! Draw a color-filled circle
961 FUNCTION-ALIAS: draw-circle-sector void DrawCircleSector ( Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color )       ! Draw a piece of a circle
962 FUNCTION-ALIAS: draw-circle-sector-lines void DrawCircleSectorLines ( Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color )  ! Draw circle sector outline
963 FUNCTION-ALIAS: draw-circle-gradient void DrawCircleGradient ( int centerX, int centerY, float radius, Color color1, Color color2 )        ! Draw a gradient-filled circle
964 FUNCTION-ALIAS: draw-circle-v void DrawCircleV ( Vector2 center, float radius, Color color )                                     ! Draw a color-filled circle (Vector version)
965 FUNCTION-ALIAS: draw-circle-lines void DrawCircleLines ( int centerX, int centerY, float radius, Color color )                   ! Draw circle outline
966 FUNCTION-ALIAS: draw-ellipse void DrawEllipse ( int centerX, int centerY, float radiusH, float radiusV, Color color )            ! Draw ellipse
967 FUNCTION-ALIAS: draw-ellipse-lines void DrawEllipseLines ( int centerX, int centerY, float radiusH, float radiusV, Color color ) ! Draw ellipse outline
968 FUNCTION-ALIAS: draw-ring void DrawRing ( Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color )  ! Draw ring
969 FUNCTION-ALIAS: draw-ring-lines void DrawRingLines ( Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color )     ! Draw ring outline
970 FUNCTION-ALIAS: draw-rectangle void DrawRectangle ( int posX, int posY, int width, int height, Color color )                     ! Draw a color-filled rectangle
971 FUNCTION-ALIAS: draw-rectangle-v void DrawRectangleV ( Vector2 position, Vector2 size, Color color )                             ! Draw a color-filled rectangle (Vector version)
972 FUNCTION-ALIAS: draw-rectangle-rec void DrawRectangleRec ( Rectangle rec, Color color )                                          ! Draw a color-filled rectangle
973 FUNCTION-ALIAS: draw-rectangle-pro void DrawRectanglePro ( Rectangle rec, Vector2 origin, float rotation, Color color )          ! Draw a color-filled rectangle with pro parameters
974 FUNCTION-ALIAS: draw-rectangle-gradient-v void DrawRectangleGradientV ( int posX, int posY, int width, int height, Color color1, Color color2 ) ! Draw a vertical-gradient-filled rectangle
975 FUNCTION-ALIAS: draw-rectangle-gradient-h void DrawRectangleGradientH ( int posX, int posY, int width, int height, Color color1, Color color2 ) ! Draw a horizontal-gradient-filled rectangle
976 FUNCTION-ALIAS: draw-rectangle-gradient-ex void DrawRectangleGradientEx ( Rectangle rec, Color col1, Color col2, Color col3, Color col4 )        ! Draw a gradient-filled rectangle with custom vertex colors
977 FUNCTION-ALIAS: draw-rectangle-lines void DrawRectangleLines ( int posX, int posY, int width, int height, Color color )          ! Draw rectangle outline
978 FUNCTION-ALIAS: draw-rectangle-lines-ex void DrawRectangleLinesEx ( Rectangle rec, float lineThick, Color color )                ! Draw rectangle outline with extended parameters
979 FUNCTION-ALIAS: draw-rectangle-rounded void DrawRectangleRounded ( Rectangle rec, float roundness, int segments, Color color )   ! Draw rectangle with rounded edges
980 FUNCTION-ALIAS: draw-rectangle-rounded-lines void DrawRectangleRoundedLines ( Rectangle rec, float roundness, int segments, float lineThick, Color color )  ! Draw rectangle with rounded edges outline
981 FUNCTION-ALIAS: draw-triangle void DrawTriangle ( Vector2 v1, Vector2 v2, Vector2 v3, Color color )                              ! Draw a color-filled triangle (vertex in counter-clockwise order!)
982 FUNCTION-ALIAS: draw-triangle-lines void DrawTriangleLines ( Vector2 v1, Vector2 v2, Vector2 v3, Color color )                   ! Draw triangle outline (vertex in counter-clockwise order!)
983 FUNCTION-ALIAS: draw-triangle-fan void DrawTriangleFan ( Vector2* points, int pointCount, Color color )                          ! Draw a triangle fan defined by points (first vertex is the center)
984 FUNCTION-ALIAS: draw-triangle-strip void DrawTriangleStrip ( Vector2* points, int pointCount, Color color )                      ! Draw a triangle strip defined by points
985 FUNCTION-ALIAS: draw-poly void DrawPoly ( Vector2 center, int sides, float radius, float rotation, Color color )                 ! Draw a regular polygon (Vector version)
986 FUNCTION-ALIAS: draw-poly-lines void DrawPolyLines ( Vector2 center, int sides, float radius, float rotation, Color color )      ! Draw a polygon outline of n sides
987 FUNCTION-ALIAS: draw-poly-lines-ex void DrawPolyLinesEx ( Vector2 center, int sides, float radius, float rotation, float lineThick, Color color )  ! Draw a polygon outline of n sides with extended parameters
988
989 ! Basic shapes collision detection functions
990 FUNCTION-ALIAS: check-collision-recs bool CheckCollisionRecs ( Rectangle rec1, Rectangle rec2 )                                  ! Check collision between two rectangles
991 FUNCTION-ALIAS: check-collision-circles bool CheckCollisionCircles ( Vector2 center1, float radius1, Vector2 center2, float radius2 ) ! Check collision between two circles
992 FUNCTION-ALIAS: check-collision-circle-rec bool CheckCollisionCircleRec ( Vector2 center, float radius, Rectangle rec )          ! Check collision between circle and rectangle
993 FUNCTION-ALIAS: check-collision-point-rec bool CheckCollisionPointRec ( Vector2 point, Rectangle rec )                           ! Check if point is inside rectangle FUNCTION-ALIAS: check-collision-point-circle bool CheckCollisionPointCircle ( Vector2 point, Vector2 center, float radius )                        ! Check if point is inside circle
994 FUNCTION-ALIAS: check-collision-point-triangle bool CheckCollisionPointTriangle ( Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3 ) ! Check if point is inside a triangle
995 FUNCTION-ALIAS: check-collision-lines bool CheckCollisionLines ( Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2* collisionPoint )  ! Check the collision between two lines defined by two points each, returns collision point by reference
996 FUNCTION-ALIAS: check-collision-point-line bool CheckCollisionPointLine ( Vector2 point, Vector2 p1, Vector2 p2, int threshold ) ! Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
997 FUNCTION-ALIAS: get-collision-rec Rectangle GetCollisionRec ( Rectangle rec1, Rectangle rec2 )                                   ! Get collision rectangle for two rectangles collision
998
999 ! ------------------------------------------------------------------------------------
1000 ! Texture Loading and Drawing Functions (Module: textures)
1001 ! ------------------------------------------------------------------------------------
1002
1003 ! Image loading functions
1004 ! NOTE: This functions do not require GPU access
1005 FUNCTION-ALIAS: load-image Image LoadImage ( c-string fileName )                                                                 ! Load image from file into CPU memory (RAM)
1006 FUNCTION-ALIAS: load-image-raw Image LoadImageRaw ( c-string fileName, int width, int height, int format, int headerSize )       ! Load image from RAW file data
1007 FUNCTION-ALIAS: load-image-anim Image LoadImageAnim ( c-string fileName, int* frames )                                           ! Load image sequence from file (frames appended to image.data)
1008 FUNCTION-ALIAS: load-image-from-memory Image LoadImageFromMemory ( c-string fileType, c-string fileData, int dataSize )          ! Load image from memory buffer, fileType refers to extension: i.e. '.png'
1009 FUNCTION-ALIAS: load-image-from-texture Image LoadImageFromTexture ( Texture2D texture )                                         ! Load image from GPU texture data
1010 FUNCTION-ALIAS: load-image-from-screen Image LoadImageFromScreen ( )                                                             ! Load image from screen buffer and (screenshot)
1011 FUNCTION-ALIAS: unload-image void UnloadImage ( Image image )                                                                    ! Unload image from CPU memory (RAM)
1012 FUNCTION-ALIAS: export-image bool ExportImage ( Image image, c-string fileName )                                                 ! Export image data to file, returns true on success
1013 FUNCTION-ALIAS: export-image-as-code bool ExportImageAsCode ( Image image, c-string fileName )                                   ! Export image as code file defining an array of bytes, returns true on success
1014
1015 ! Image generation functions
1016 FUNCTION-ALIAS: gen-image-color Image GenImageColor ( int width, int height, Color color )                                       ! Generate image: plain color
1017 FUNCTION-ALIAS: gen-image-gradient-v Image GenImageGradientV ( int width, int height, Color top, Color bottom )                  ! Generate image: vertical gradient
1018 FUNCTION-ALIAS: gen-image-gradient-h Image GenImageGradientH ( int width, int height, Color left, Color right )                  ! Generate image: horizontal gradient
1019 FUNCTION-ALIAS: gen-image-gradient-radial Image GenImageGradientRadial ( int width, int height, float density, Color inner, Color outer ) ! Generate image: radial gradient
1020 FUNCTION-ALIAS: gen-image-checked Image GenImageChecked ( int width, int height, int checksX, int checksY, Color col1, Color col2 ) ! Generate image: checked
1021 FUNCTION-ALIAS: gen-image-white-noise Image GenImageWhiteNoise ( int width, int height, float factor )                           ! Generate image: white noise
1022 FUNCTION-ALIAS: gen-image-cellular Image GenImageCellular ( int width, int height, int tileSize )                                ! Generate image: cellular algorithm, bigger tileSize means bigger cells
1023
1024 ! Image manipulation functions
1025 FUNCTION-ALIAS: image-copy Image ImageCopy ( Image image )                                                                       ! Create an image duplicate (useful for transformations)
1026 FUNCTION-ALIAS: image-from-image Image ImageFromImage ( Image image, Rectangle rec )                                             ! Create an image from another image piece
1027 FUNCTION-ALIAS: image-text Image ImageText ( c-string text, int fontSize, Color color )                                          ! Create an image from text (default font)
1028 FUNCTION-ALIAS: image-text-ex Image ImageTextEx ( Font font, c-string text, float fontSize, float spacing, Color tint )          ! Create an image from text (custom sprite font)
1029 FUNCTION-ALIAS: image-format void ImageFormat ( Image* image, int newformat )                                                    ! Convert image data to desired format
1030 FUNCTION-ALIAS: image-to-pot void ImageToPOT ( Image* image, Color fill )                                                        ! Convert image to POT (power-of-two)
1031 FUNCTION-ALIAS: image-crop void ImageCrop ( Image* image, Rectangle crop )                                                       ! Crop an image to a defined rectangle
1032 FUNCTION-ALIAS: image-alpha-crop void ImageAlphaCrop ( Image* image, float threshold )                                           ! Crop image depending on alpha value
1033 FUNCTION-ALIAS: image-alpha-clear void ImageAlphaClear ( Image* image, Color color, float threshold )                            ! Clear alpha channel to desired color
1034 FUNCTION-ALIAS: image-alpha-mask void ImageAlphaMask ( Image* image, Image alphaMask )                                           ! Apply alpha mask to image
1035 FUNCTION-ALIAS: image-alpha-premultiply void ImageAlphaPremultiply ( Image* image )                                              ! Premultiply alpha channel
1036 FUNCTION-ALIAS: image-resize void ImageResize ( Image* image, int newWidth, int newHeight )                                      ! Resize image (Bicubic scaling algorithm)
1037 FUNCTION-ALIAS: image-resize-nn void ImageResizeNN ( Image* image, int newWidth, int newHeight )                                 ! Resize image (Nearest-Neighbor scaling algorithm)
1038 FUNCTION-ALIAS: image-resize-canvas void ImageResizeCanvas ( Image* image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill )  ! Resize canvas and fill with color
1039 FUNCTION-ALIAS: image-mipmaps void ImageMipmaps ( Image* image )                                                                 ! Compute all mipmap levels for a provided image
1040 FUNCTION-ALIAS: image-dither void ImageDither ( Image* image, int rBpp, int gBpp, int bBpp, int aBpp )                           ! Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
1041 FUNCTION-ALIAS: image-flip-vertical void ImageFlipVertical ( Image* image )                                                      ! Flip image vertically
1042 FUNCTION-ALIAS: image-flip-horizontal void ImageFlipHorizontal ( Image* image )                                                  ! Flip image horizontally
1043 FUNCTION-ALIAS: image-rotate-cw void ImageRotateCW ( Image* image )                                                              ! Rotate image clockwise 90deg
1044 FUNCTION-ALIAS: image-rotate-ccw void ImageRotateCCW ( Image* image )                                                            ! Rotate image counter-clockwise 90deg
1045 FUNCTION-ALIAS: image-color-tint void ImageColorTint ( Image* image, Color color )                                               ! Modify image color: tint
1046 FUNCTION-ALIAS: image-color-invert void ImageColorInvert ( Image* image )                                                        ! Modify image color: invert
1047 FUNCTION-ALIAS: image-color-grayscale void ImageColorGrayscale ( Image* image )                                                  ! Modify image color: grayscale
1048 FUNCTION-ALIAS: image-color-contrast void ImageColorContrast ( Image* image, float contrast )                                    ! Modify image color: contrast (-100 to 100)
1049 FUNCTION-ALIAS: image-color-brightness void ImageColorBrightness ( Image* image, int brightness )                                ! Modify image color: brightness (-255 to 255)
1050 FUNCTION-ALIAS: image-color-replace void ImageColorReplace ( Image* image, Color color, Color replace )                          ! Modify image color: replace color
1051 FUNCTION-ALIAS: load-image-colors Color* LoadImageColors ( Image image )                                                         ! Load color data from image as a Color array (RGBA - 32bit)
1052 FUNCTION-ALIAS: load-image-palette Color* LoadImagePalette ( Image image, int maxPaletteSize, int* colorCount )                  ! Load colors palette from image as a Color array (RGBA - 32bit)
1053 FUNCTION-ALIAS: unload-image-colors void UnloadImageColors ( Color* colors )                                                     ! Unload color data loaded with LoadImageColors()
1054 FUNCTION-ALIAS: unload-image-palette void UnloadImagePalette ( Color* colors )                                                   ! Unload colors palette loaded with LoadImagePalette()
1055 FUNCTION-ALIAS: get-image-alpha-border Rectangle GetImageAlphaBorder ( Image image, float threshold )                            ! Get image alpha border rectangle
1056 FUNCTION-ALIAS: get-image-color Color GetImageColor ( Image image, int x, int y )                                                ! Get image pixel color at (x, y) position
1057
1058 ! Image drawing functions
1059 ! NOTE: Image software-rendering functions (CPU)
1060 FUNCTION-ALIAS: image-clear-background void ImageClearBackground ( Image* dst, Color color )                                     ! Clear image background with given color
1061 FUNCTION-ALIAS: image-draw-pixel void ImageDrawPixel ( Image* dst, int posX, int posY, Color color )                             ! Draw pixel within an image
1062 FUNCTION-ALIAS: image-draw-pixel-v void ImageDrawPixelV ( Image* dst, Vector2 position, Color color )                            ! Draw pixel within an image (Vector version)
1063 FUNCTION-ALIAS: image-draw-line void ImageDrawLine ( Image* dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color ) ! Draw line within an image
1064 FUNCTION-ALIAS: image-draw-line-v void ImageDrawLineV ( Image* dst, Vector2 start, Vector2 end, Color color )                    ! Draw line within an image (Vector version)
1065 FUNCTION-ALIAS: image-draw-circle void ImageDrawCircle ( Image* dst, int centerX, int centerY, int radius, Color color )         ! Draw circle within an image
1066 FUNCTION-ALIAS: image-draw-circle-v void ImageDrawCircleV ( Image* dst, Vector2 center, int radius, Color color )                ! Draw circle within an image (Vector version)
1067 FUNCTION-ALIAS: image-draw-rectangle void ImageDrawRectangle ( Image* dst, int posX, int posY, int width, int height, Color color ) ! Draw rectangle within an image
1068 FUNCTION-ALIAS: image-draw-rectangle-v void ImageDrawRectangleV ( Image* dst, Vector2 position, Vector2 size, Color color )      ! Draw rectangle within an image (Vector version)
1069 FUNCTION-ALIAS: image-draw-rectangle-rec void ImageDrawRectangleRec ( Image* dst, Rectangle rec, Color color )                   ! Draw rectangle within an image
1070 FUNCTION-ALIAS: image-draw-rectangle-lines void ImageDrawRectangleLines ( Image* dst, Rectangle rec, int thick, Color color )    ! Draw rectangle lines within an image
1071 FUNCTION-ALIAS: image-draw void ImageDraw ( Image* dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint )              ! Draw a source image within a destination image (tint applied to source)
1072 FUNCTION-ALIAS: image-draw-text void ImageDrawText ( Image* dst, c-string text, int posX, int posY, int fontSize, Color color )  ! Draw text (using default font) within an image (destination)
1073 FUNCTION-ALIAS: image-draw-text-ex void ImageDrawTextEx ( Image* dst, Font font, c-string text, Vector2 position, float fontSize, float spacing, Color tint )  ! Draw text (custom sprite font) within an image (destination)
1074
1075 ! Texture loading functions
1076 ! NOTE: These functions require GPU access
1077 FUNCTION-ALIAS: load-texture Texture2D LoadTexture ( c-string fileName )                                                         ! Load texture from file into GPU memory (VRAM)
1078 FUNCTION-ALIAS: load-texture-from-image Texture2D LoadTextureFromImage ( Image image )                                           ! Load texture from image data
1079 FUNCTION-ALIAS: load-texture-cubemap TextureCubemap LoadTextureCubemap ( Image image, CubemapLayout layout )                     ! Load cubemap from image, multiple image cubemap layouts supported
1080 FUNCTION-ALIAS: load-render-texture RenderTexture2D LoadRenderTexture ( int width, int height )                                  ! Load texture for rendering (framebuffer)
1081 FUNCTION-ALIAS: unload-texture void UnloadTexture ( Texture2D texture )                                                          ! Unload texture from GPU memory (VRAM)
1082 FUNCTION-ALIAS: unload-render-texture void UnloadRenderTexture ( RenderTexture2D target )                                        ! Unload render texture from GPU memory (VRAM)
1083 FUNCTION-ALIAS: update-texture void UpdateTexture ( Texture2D texture, void* pixels )                                            ! Update GPU texture with new data
1084 FUNCTION-ALIAS: update-texture-rec void UpdateTextureRec ( Texture2D texture, Rectangle rec, void* pixels )                      ! Update GPU texture rectangle with new data
1085
1086 ! Texture configuration functions
1087 FUNCTION-ALIAS: gen-texture-mipmaps void GenTextureMipmaps ( Texture2D* texture )                                                ! Generate GPU mipmaps for a texture
1088 FUNCTION-ALIAS: set-texture-filter void SetTextureFilter ( Texture2D texture, TextureFilterMode filter )                         ! Set texture scaling filter mode
1089 FUNCTION-ALIAS: set-texture-wrap void SetTextureWrap ( Texture2D texture, TextureWrapMode wrap )                                 ! Set texture wrapping mode
1090
1091 ! Texture drawing functions
1092 FUNCTION-ALIAS: draw-texture void DrawTexture ( Texture2D texture, int posX, int posY, Color tint )                              ! Draw a Texture2D
1093 FUNCTION-ALIAS: draw-texture-v void DrawTextureV ( Texture2D texture, Vector2 position, Color tint )                             ! Draw a Texture2D with position defined as Vector2
1094 FUNCTION-ALIAS: draw-texture-ex void DrawTextureEx ( Texture2D texture, Vector2 position, float rotation, float scale, Color tint ) ! Draw a Texture2D with extended parameters
1095 FUNCTION-ALIAS: draw-texture-rec void DrawTextureRec ( Texture2D texture, Rectangle source, Vector2 position, Color tint )       ! Draw a part of a texture defined by a rectangle
1096 FUNCTION-ALIAS: draw-texture-quad void DrawTextureQuad ( Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint ) ! Draw texture quad with tiling and offset parameters
1097 FUNCTION-ALIAS: draw-texture-tiled void DrawTextureTiled ( Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint ) ! Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest.
1098 FUNCTION-ALIAS: draw-texture-pro void DrawTexturePro ( Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint ) ! Draw a part of a texture defined by a rectangle with 'pro' parameters
1099 FUNCTION-ALIAS: draw-texture-npatch void DrawTextureNPatch ( Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint ) ! Draws a texture (or part of it) that stretches or shrinks nicely
1100 FUNCTION-ALIAS: draw-texture-poly void DrawTexturePoly ( Texture2D texture, Vector2 center, Vector2* points, Vector2* texcoords, int pointCount, Color tint ) ! Draw a textured polygon
1101
1102 ! Color/pixel related functions
1103 FUNCTION-ALIAS: fade Color Fade ( Color color, float alpha )                                   ! Get color with alpha applied, alpha goes from 0.0f to 1.0f
1104 FUNCTION-ALIAS: color-to-int int ColorToInt ( Color color )                                    ! Get hexadecimal value for a Color
1105 FUNCTION-ALIAS: color-normalize Vector4 ColorNormalize ( Color color )                         ! Get Color normalized as float [0..1]
1106 FUNCTION-ALIAS: color-from-normalized Color ColorFromNormalized ( Vector4 normalized )         ! Get Color from normalized values [0..1]
1107 FUNCTION-ALIAS: color-to-hsv Vector3 ColorToHSV ( Color color )                                ! Get HSV values for a Color, hue [0..360], saturation/value [0..1]
1108 FUNCTION-ALIAS: color-from-hsv Color ColorFromHSV ( float hue, float saturation, float value ) ! Get a Color from HSV values, hue [0..360], saturation/value [0..1]
1109 FUNCTION-ALIAS: color-alpha Color ColorAlpha ( Color color, float alpha )                      ! Get color with alpha applied, alpha goes from 0.0f to 1.0f
1110 FUNCTION-ALIAS: color-alpha-blend Color ColorAlphaBlend ( Color dst, Color src, Color tint )   ! Get src alpha-blended into dst color with tint
1111 FUNCTION-ALIAS: get-color Color GetColor ( uint hexValue )                                     ! Get Color structure from hexadecimal value
1112 FUNCTION-ALIAS: get-pixel-color Color GetPixelColor ( void* srcPtr, PixelFormat format )               ! Get Color from a source pixel pointer of certain format
1113 FUNCTION-ALIAS: set-pixel-color void SetPixelColor ( void* dstPtr, Color color, PixelFormat format )   ! Set color formatted into destination pixel pointer
1114 FUNCTION-ALIAS: get-pixel-data-size int GetPixelDataSize ( int width, int height, PixelFormat format ) ! Get pixel data size in bytes for certain format
1115
1116 ! ------------------------------------------------------------------------------------
1117 ! Font Loading and Text Drawing Functions (Module: text)
1118 ! ------------------------------------------------------------------------------------
1119
1120 ! Font loading/unloading functions
1121 FUNCTION-ALIAS: get-font-default Font GetFontDefault ( )                                                             ! Get the default Font
1122 FUNCTION-ALIAS: load-font Font LoadFont ( c-string fileName )                                                        ! Load font from file into GPU memory (VRAM)
1123 FUNCTION-ALIAS: load-font-ex Font LoadFontEx ( c-string fileName, int fontSize, int* fontChars, int glyphCount )     ! Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
1124 FUNCTION-ALIAS: load-font-from-image Font LoadFontFromImage ( Image image, Color key, int firstChar )                ! Load font from Image (XNA style)
1125 FUNCTION-ALIAS: load-font-from-memory Font LoadFontFromMemory ( c-string fileType, c-string fileData, int dataSize, int fontSize, int* fontChars, int glyphCount )  ! Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
1126 FUNCTION-ALIAS: load-font-data GlyphInfo* LoadFontData ( c-string  fileData, int dataSize, int fontSize, int* fontChars, int glyphCount, FontType type )  ! Load font data for further use
1127 FUNCTION-ALIAS: gen-image-font-atlas Image GenImageFontAtlas ( GlyphInfo* chars, Rectangle** recs, int glyphCount, int fontSize, int padding, int packMethod )  ! Generate image font atlas using chars info
1128 FUNCTION-ALIAS: unload-font-data void UnloadFontData ( GlyphInfo* chars, int glyphCount )                            ! Unload font chars info data (RAM)
1129 FUNCTION-ALIAS: unload-font void UnloadFont ( Font font )                                                            ! Unload Font from GPU memory (VRAM)
1130
1131 ! Text drawing functions
1132 FUNCTION-ALIAS: draw-fps void DrawFPS ( int posX, int posY )                                                         ! Draw current FPS
1133 FUNCTION-ALIAS: draw-text void DrawText ( c-string text, int posX, int posY, int fontSize, Color color )             ! Draw text (using default font)
1134 FUNCTION-ALIAS: draw-text-ex void DrawTextEx ( Font font, c-string text, Vector2 position, float fontSize, float spacing, Color tint )  ! Draw text using font and additional parameters
1135 FUNCTION-ALIAS: draw-text-pro void DrawTextPro ( Font font, c-string text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint )  ! Draw text using Font and pro parameters (rotation)
1136 FUNCTION-ALIAS: draw-text-codepoint void DrawTextCodepoint ( Font font, int codepoint, Vector2 position, float fontSize, Color tint )  ! Draw one character (codepoint)
1137
1138 ! Text font info functions
1139 FUNCTION-ALIAS: measure-text int MeasureText ( c-string text, int fontSize )                                         ! Measure string width for default font
1140 FUNCTION-ALIAS: measure-text-ex Vector2 MeasureTextEx ( Font font, c-string text, float fontSize, float spacing )    ! Measure string size for Font
1141 FUNCTION-ALIAS: get-glyph-index int GetGlyphIndex ( Font font, int codepoint )                                       ! Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
1142 FUNCTION-ALIAS: get-glyph-info GlyphInfo GetGlyphInfo ( Font font, int codepoint )                                   ! Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
1143 FUNCTION-ALIAS: get-glyph-atlas-rec Rectangle GetGlyphAtlasRec ( Font font, int codepoint )                          ! Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
1144
1145 ! Text codepoints management functions (unicode characters)
1146 FUNCTION-ALIAS: load-codepoints int* LoadCodepoints ( c-string text, int* count )                     ! Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
1147 FUNCTION-ALIAS: unload-codepoints void UnloadCodepoints ( int* codepoints )                           ! Unload codepoints data from memory
1148 FUNCTION-ALIAS: get-codepoint-count int GetCodepointCount ( c-string text )                           ! Get total number of codepoints in a UTF-8 encoded string
1149 FUNCTION-ALIAS: get-codepoint int GetCodepoint ( c-string text, int* bytesProcessed )                 ! Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
1150 FUNCTION-ALIAS: codepoint-to-utf8 c-string CodepointToUTF8 ( int codepoint, int* byteSize )           ! Encode one codepoint into UTF-8 byte array (array length returned as parameter)
1151 FUNCTION-ALIAS: text-codepoints-to-utf8 c-string TextCodepointsToUTF8 ( int* codepoints, int length ) ! Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!)
1152
1153 ! Text strings management functions (no UTF-8 strings, only byte chars)
1154 ! NOTE: Some strings allocate memory internally for returned strings, just be careful!
1155 FUNCTION-ALIAS: text-copy int TextCopy ( c-string  dst, c-string src )                                ! Copy one string to another, returns bytes copied
1156 FUNCTION-ALIAS: text-is-equal bool TextIsEqual ( c-string text1, c-string text2 )                     ! Check if two text string are equal
1157 FUNCTION-ALIAS: text-length uint TextLength ( c-string text )                                         ! Get text length, checks for '\0' ending
1158 ! FUNCTION: c-string TextFormat ( c-string text, ... )                                                  ! Text formatting with variables (sprintf() style)
1159 FUNCTION-ALIAS: text-subtext c-string TextSubtext ( c-string text, int position, int length )         ! Get a piece of a text string
1160 FUNCTION-ALIAS: text-replace c-string TextReplace ( c-string  text, c-string replace, c-string by )   ! Replace text string (WARNING: memory must be freed!)
1161 FUNCTION-ALIAS: text-insert c-string TextInsert ( c-string text, c-string insert, int position )      ! Insert text in a position (WARNING: memory must be freed!)
1162 FUNCTION-ALIAS: text-join c-string TextJoin ( c-string* textList, int count, c-string delimiter )     ! Join text strings with delimiter
1163 FUNCTION-ALIAS: text-split c-string* TextSplit ( c-string text, char delimiter, int* count )          ! Split text into multiple strings
1164 FUNCTION-ALIAS: text-append void TextAppend ( c-string text, c-string append, int* position )         ! Append text at specific position and move cursor!
1165 FUNCTION-ALIAS: text-find-index int TextFindIndex ( c-string text, c-string find )                    ! Find first text occurrence within a string
1166 FUNCTION-ALIAS: text-to-upper c-string TextToUpper ( c-string text )                                  ! Get upper case version of provided string
1167 FUNCTION-ALIAS: text-to-lower c-string TextToLower ( c-string text )                                  ! Get lower case version of provided string
1168 FUNCTION-ALIAS: text-to-pascal c-string TextToPascal ( c-string text )                                ! Get Pascal case notation version of provided string
1169 FUNCTION-ALIAS: text-to-integer int TextToInteger ( c-string text )                                   ! Get integer value from text (negative values not supported)
1170
1171 ! ------------------------------------------------------------------------------------
1172 ! Basic 3d Shapes Drawing Functions (Module: models)
1173 ! ------------------------------------------------------------------------------------
1174
1175 ! Basic geometric 3D shapes drawing functions
1176 FUNCTION-ALIAS: draw-line-3d void DrawLine3D ( Vector3 startPos, Vector3 endPos, Color color )        ! Draw a line in 3D world space
1177 FUNCTION-ALIAS: draw-point-3d void DrawPoint3D ( Vector3 position, Color color )                      ! Draw a point in 3D space, actually a small line
1178 FUNCTION-ALIAS: draw-circle-3d void DrawCircle3D ( Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color )  ! Draw a circle in 3D world space
1179 FUNCTION-ALIAS: draw-triangle-3d void DrawTriangle3D ( Vector3 v1, Vector3 v2, Vector3 v3, Color color ) ! Draw a color-filled triangle (vertex in counter-clockwise order!)
1180 FUNCTION-ALIAS: draw-triangle-strip-3d void DrawTriangleStrip3D ( Vector3* points, int pointCount, Color color ) ! Draw a triangle strip defined by points
1181 FUNCTION-ALIAS: draw-cube void DrawCube ( Vector3 position, float width, float height, float length, Color color ) ! Draw cube
1182 FUNCTION-ALIAS: draw-cube-v void DrawCubeV ( Vector3 position, Vector3 size, Color color )            ! Draw cube (Vector version)
1183 FUNCTION-ALIAS: draw-cube-wires void DrawCubeWires ( Vector3 position, float width, float height, float length, Color color ) ! Draw cube wires
1184 FUNCTION-ALIAS: draw-cube-wires-v void DrawCubeWiresV ( Vector3 position, Vector3 size, Color color ) ! Draw cube wires (Vector version)
1185 FUNCTION-ALIAS: draw-cube-texture void DrawCubeTexture ( Texture2D texture, Vector3 position, float width, float height, float length, Color color )  ! Draw cube textured
1186 FUNCTION-ALIAS: draw-cube-texture-rec void DrawCubeTextureRec ( Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color )  ! Draw cube with a region of a texture
1187 FUNCTION-ALIAS: draw-sphere void DrawSphere ( Vector3 centerPos, float radius, Color color )          ! Draw sphere
1188 FUNCTION-ALIAS: draw-sphere-ex void DrawSphereEx ( Vector3 centerPos, float radius, int rings, int slices, Color color ) ! Draw sphere with extended parameters
1189 FUNCTION-ALIAS: draw-sphere-wires void DrawSphereWires ( Vector3 centerPos, float radius, int rings, int slices, Color color ) ! Draw sphere wires
1190 FUNCTION-ALIAS: draw-cylinder void DrawCylinder ( Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color )  ! Draw a cylinder/cone
1191 FUNCTION-ALIAS: draw-cylinder-ex void DrawCylinderEx ( Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color )  ! Draw a cylinder with base at startPos and top at endPos
1192 FUNCTION-ALIAS: draw-cylinder-wires void DrawCylinderWires ( Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color )  ! Draw a cylinder/cone wires
1193 FUNCTION-ALIAS: draw-cylinder-wires-ex void DrawCylinderWiresEx ( Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color )  ! Draw a cylinder wires with base at startPos and top at endPos
1194 FUNCTION-ALIAS: draw-plane void DrawPlane ( Vector3 centerPos, Vector2 size, Color color )            ! Draw a plane XZ
1195 FUNCTION-ALIAS: draw-ray void DrawRay ( Ray ray, Color color )                                        ! Draw a ray line
1196 FUNCTION-ALIAS: draw-grid void DrawGrid ( int slices, float spacing )                                 ! Draw a grid (centered at (0, 0, 0))
1197
1198 ! ------------------------------------------------------------------------------------
1199 ! Model 3d Loading and Drawing Functions (Module: models)
1200 ! ------------------------------------------------------------------------------------
1201
1202 ! Model management functions
1203 FUNCTION-ALIAS: load-model Model LoadModel ( c-string fileName )                                      ! Load model from files (meshes and materials)
1204 FUNCTION-ALIAS: load-model-from-mesh Model LoadModelFromMesh ( Mesh mesh )                            ! Load model from generated mesh (default material)
1205 FUNCTION-ALIAS: unload-model void UnloadModel ( Model model )                                         ! Unload model (including meshes) from memory (RAM and/or VRAM)
1206 FUNCTION-ALIAS: unload-model-keep-meshes void UnloadModelKeepMeshes ( Model model )                   ! Unload model (but not meshes) from memory (RAM and/or VRAM)
1207 FUNCTION-ALIAS: get-model-bounding-box BoundingBox GetModelBoundingBox ( Model model )                ! Compute model bounding box limits (considers all meshes)
1208
1209 ! Model drawing functions
1210 FUNCTION-ALIAS: draw-model void DrawModel ( Model model, Vector3 position, float scale, Color tint )  ! Draw a model (with texture if set)
1211 FUNCTION-ALIAS: draw-model-ex void DrawModelEx ( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint )  ! Draw a model with extended parameters
1212 FUNCTION-ALIAS: draw-model-wires void DrawModelWires ( Model model, Vector3 position, float scale, Color tint ) ! Draw a model wires (with texture if set)
1213 FUNCTION-ALIAS: draw-model-wires-ex void DrawModelWiresEx ( Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint )  ! Draw a model wires (with texture if set) with extended parameters
1214 FUNCTION-ALIAS: draw-bounding-box void DrawBoundingBox ( BoundingBox box, Color color )               ! Draw bounding box (wires)
1215 FUNCTION-ALIAS: draw-billboard void DrawBillboard ( Camera camera, Texture2D texture, Vector3 position, float size, Color tint ) ! Draw a billboard texture
1216 FUNCTION-ALIAS: draw-billboard-rec void DrawBillboardRec ( Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint )  ! Draw a billboard texture defined by source
1217 FUNCTION-ALIAS: draw-billboard-pro void DrawBillboardPro ( Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint )  ! Draw a billboard texture defined by source and rotation
1218
1219 ! Mesh management functions
1220 FUNCTION-ALIAS: upload-mesh void UploadMesh ( Mesh* mesh, bool dynamic )                              ! Upload mesh vertex data in GPU and provide VAO/VBO ids
1221 FUNCTION-ALIAS: update-mesh-buffer void UpdateMeshBuffer ( Mesh mesh, int index, void* data, int dataSize, int offset ) ! Update mesh vertex data in GPU for a specific buffer index
1222 FUNCTION-ALIAS: unload-mesh void UnloadMesh ( Mesh mesh )                                             ! Unload mesh data from CPU and GPU
1223 FUNCTION-ALIAS: draw-mesh void DrawMesh ( Mesh mesh, Material material, Matrix transform )            ! Draw a 3d mesh with material and transform
1224 FUNCTION-ALIAS: draw-mesh-instanced void DrawMeshInstanced ( Mesh mesh, Material material, Matrix* transforms, int instances )  ! Draw multiple mesh instances with material and different transforms
1225 FUNCTION-ALIAS: export-mesh bool ExportMesh ( Mesh mesh, c-string fileName )                          ! Export mesh data to file, returns true on success
1226 FUNCTION-ALIAS: get-mesh-bounding-box BoundingBox GetMeshBoundingBox ( Mesh mesh )                    ! Compute mesh bounding box limits
1227 FUNCTION-ALIAS: gen-mesh-tangents void GenMeshTangents ( Mesh* mesh )                                 ! Compute mesh tangents
1228 FUNCTION-ALIAS: gen-mesh-binormals void GenMeshBinormals ( Mesh* mesh )                               ! Compute mesh binormals
1229
1230 ! Mesh generation functions
1231 FUNCTION-ALIAS: gen-mesh-poly Mesh GenMeshPoly ( int sides, float radius )                            ! Generate polygonal mesh
1232 FUNCTION-ALIAS: gen-mesh-plane Mesh GenMeshPlane ( float width, float length, int resX, int resZ )    ! Generate plane mesh (with subdivisions)
1233 FUNCTION-ALIAS: gen-mesh-cube Mesh GenMeshCube ( float width, float height, float length )            ! Generate cuboid mesh
1234 FUNCTION-ALIAS: gen-mesh-sphere Mesh GenMeshSphere ( float radius, int rings, int slices )            ! Generate sphere mesh (standard sphere)
1235 FUNCTION-ALIAS: gen-mesh-hemi-sphere Mesh GenMeshHemiSphere ( float radius, int rings, int slices )   ! Generate half-sphere mesh (no bottom cap)
1236 FUNCTION-ALIAS: gen-mesh-cylinder Mesh GenMeshCylinder ( float radius, float height, int slices )     ! Generate cylinder mesh
1237 FUNCTION-ALIAS: gen-mesh-cone Mesh GenMeshCone ( float radius, float height, int slices )             ! Generate cone/pyramid mesh
1238 FUNCTION-ALIAS: gen-mesh-torus Mesh GenMeshTorus ( float radius, float size, int radSeg, int sides )  ! Generate torus mesh
1239 FUNCTION-ALIAS: gen-mesh-knot Mesh GenMeshKnot ( float radius, float size, int radSeg, int sides )    ! Generate trefoil knot mesh
1240 FUNCTION-ALIAS: gen-mesh-heightmap Mesh GenMeshHeightmap ( Image heightmap, Vector3 size )            ! Generate heightmap mesh from image data
1241 FUNCTION-ALIAS: gen-mesh-cubicmap Mesh GenMeshCubicmap ( Image cubicmap, Vector3 cubeSize )           ! Generate cubes-based map mesh from image data
1242
1243 ! Material loading/unloading functions
1244 FUNCTION-ALIAS: load-materials Material* LoadMaterials ( c-string fileName, int* materialCount )      ! Load materials from model file
1245 FUNCTION-ALIAS: load-material-default Material LoadMaterialDefault ( )                                ! Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
1246 FUNCTION-ALIAS: unload-material void UnloadMaterial ( Material material )                             ! Unload material from GPU memory (VRAM)
1247 FUNCTION-ALIAS: set-material-texture void SetMaterialTexture ( Material* material, int mapType, Texture2D texture ) ! Set texture for a material map type  ( Material_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)
1248 FUNCTION-ALIAS: set-model-mesh-material void SetModelMeshMaterial ( Model* model, int meshId, int materialId ) ! Set material for a mesh
1249
1250 ! Model animations loading/unloading functions
1251 FUNCTION-ALIAS: load-model-animations ModelAnimation* LoadModelAnimations ( c-string fileName, uint* animCount ) ! Load model animations from file
1252 FUNCTION-ALIAS: update-model-animation void UpdateModelAnimation ( Model model, ModelAnimation anim, int frame ) ! Update model animation pose
1253 FUNCTION-ALIAS: unload-model-animation void UnloadModelAnimation ( ModelAnimation anim )                         ! Unload animation data
1254 FUNCTION-ALIAS: unload-model-animations void UnloadModelAnimations ( ModelAnimation* animations, uint count )    ! Unload animation array data
1255 FUNCTION-ALIAS: is-model-animation-valid bool IsModelAnimationValid ( Model model, ModelAnimation anim )         ! Check model animation skeleton match
1256
1257 ! Collision detection functions
1258 FUNCTION-ALIAS: check-collision-spheres bool CheckCollisionSpheres ( Vector3 center1, float radius1, Vector3 center2, float radius2 ) ! Check collision between two spheres
1259 FUNCTION-ALIAS: check-collision-boxes bool CheckCollisionBoxes ( BoundingBox box1, BoundingBox box2 )                                 ! Check collision between two bounding boxes
1260 FUNCTION-ALIAS: check-collision-box-sphere bool CheckCollisionBoxSphere ( BoundingBox box, Vector3 center, float radius )             ! Check collision between box and sphere
1261 FUNCTION-ALIAS: get-ray-collision-sphere RayCollision GetRayCollisionSphere ( Ray ray, Vector3 center, float radius )                 ! Get collision info between ray and sphere
1262 FUNCTION-ALIAS: get-ray-collision-box RayCollision GetRayCollisionBox ( Ray ray, BoundingBox box )                                    ! Get collision info between ray and box
1263 FUNCTION-ALIAS: get-ray-collision-model RayCollision GetRayCollisionModel ( Ray ray, Model model )                                    ! Get collision info between ray and model
1264 FUNCTION-ALIAS: get-ray-collision-mesh RayCollision GetRayCollisionMesh ( Ray ray, Mesh mesh, Matrix transform )                      ! Get collision info between ray and mesh
1265 FUNCTION-ALIAS: get-ray-collision-triangle RayCollision GetRayCollisionTriangle ( Ray ray, Vector3 p1, Vector3 p2, Vector3 p3 )       ! Get collision info between ray and triangle
1266 FUNCTION-ALIAS: get-ray-collision-quad RayCollision GetRayCollisionQuad ( Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4 )   ! Get collision info between ray and quad
1267
1268 ! ------------------------------------------------------------------------------------
1269 ! Audio Loading and Playing Functions (Module: audio)
1270 ! ------------------------------------------------------------------------------------
1271
1272 ! Audio device management functions
1273 FUNCTION-ALIAS: init-audio-device void InitAudioDevice ( )                                      ! Initialize audio device and context
1274 FUNCTION-ALIAS: close-audio-device void CloseAudioDevice ( )                                    ! Close the audio device and context
1275 FUNCTION-ALIAS: is-audio-device-ready bool IsAudioDeviceReady ( )                               ! Check if audio device has been initialized successfully
1276 FUNCTION-ALIAS: set-master-volume void SetMasterVolume ( float volume )                         ! Set master volume (listener)
1277
1278 ! Wave/Sound loading/unloading functions
1279 FUNCTION-ALIAS: load-wave Wave LoadWave ( c-string fileName )                                   ! Load wave data from file
1280 FUNCTION-ALIAS: load-wave-from-memory Wave LoadWaveFromMemory ( c-string fileType, c-string fileData, int dataSize )  ! Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
1281 FUNCTION-ALIAS: load-sound Sound LoadSound ( c-string fileName )                                ! Load sound from file
1282 FUNCTION-ALIAS: load-sound-from-wave Sound LoadSoundFromWave ( Wave wave )                      ! Load sound from wave data
1283 FUNCTION-ALIAS: update-sound void UpdateSound ( Sound sound, void* data, int sampleCount )      ! Update sound buffer with new data
1284 FUNCTION-ALIAS: unload-wave void UnloadWave ( Wave wave )                                       ! Unload wave data
1285 FUNCTION-ALIAS: unload-sound void UnloadSound ( Sound sound )                                   ! Unload sound
1286 FUNCTION-ALIAS: export-wave bool ExportWave ( Wave wave, c-string fileName )                    ! Export wave data to file, returns true on success
1287 FUNCTION-ALIAS: export-wave-as-code bool ExportWaveAsCode ( Wave wave, c-string fileName )      ! Export wave sample data to code (.h), returns true on success
1288
1289 ! Wave/Sound management functions
1290 FUNCTION-ALIAS: play-sound void PlaySound ( Sound sound )                                       ! Play a sound
1291 FUNCTION-ALIAS: stop-sound void StopSound ( Sound sound )                                       ! Stop playing a sound
1292 FUNCTION-ALIAS: pause-sound void PauseSound ( Sound sound )                                     ! Pause a sound
1293 FUNCTION-ALIAS: resume-sound void ResumeSound ( Sound sound )                                   ! Resume a paused sound
1294 FUNCTION-ALIAS: play-sound-multi void PlaySoundMulti ( Sound sound )                            ! Play a sound (using multichannel buffer pool)
1295 FUNCTION-ALIAS: stop-sound-multi void StopSoundMulti ( )                                        ! Stop any sound playing (using multichannel buffer pool)
1296 FUNCTION-ALIAS: get-sounds-playing int GetSoundsPlaying ( )                                     ! Get number of sounds playing in the multichannel
1297 FUNCTION-ALIAS: is-sound-playing bool IsSoundPlaying ( Sound sound )                            ! Check if a sound is currently playing
1298 FUNCTION-ALIAS: set-sound-volume void SetSoundVolume ( Sound sound, float volume )              ! Set volume for a sound (1.0 is max level)
1299 FUNCTION-ALIAS: set-sound-pitch void SetSoundPitch ( Sound sound, float pitch )                 ! Set pitch for a sound (1.0 is base level)
1300 FUNCTION-ALIAS: wave-format void WaveFormat ( Wave* wave, int sampleRate, int sampleSize, int channels ) ! Convert wave data to desired format
1301 FUNCTION-ALIAS: wave-copy Wave WaveCopy ( Wave wave )                                           ! Copy a wave to a new wave
1302 FUNCTION-ALIAS: wave-crop void WaveCrop ( Wave* wave, int initSample, int finalSample )         ! Crop a wave to defined samples range
1303 FUNCTION-ALIAS: load-wave-samples float* LoadWaveSamples ( Wave wave )                          ! Load samples data from wave as a floats array
1304 FUNCTION-ALIAS: unload-wave-samples void UnloadWaveSamples ( float* samples )                   ! Unload samples data loaded with LoadWaveSamples()
1305
1306 ! Music management functions
1307 FUNCTION-ALIAS: load-music-stream Music LoadMusicStream ( c-string fileName )                   ! Load music stream from file
1308 FUNCTION-ALIAS: load-music-stream-from-memory Music LoadMusicStreamFromMemory ( c-string fileType, c-string data, int dataSize ) ! Load music stream from data
1309 FUNCTION-ALIAS: unload-music-stream void UnloadMusicStream ( Music music )                      ! Unload music stream
1310 FUNCTION-ALIAS: play-music-stream void PlayMusicStream ( Music music )                          ! Start music playing
1311 FUNCTION-ALIAS: is-music-stream-playing bool IsMusicStreamPlaying ( Music music )               ! Check if music is playing
1312 FUNCTION-ALIAS: update-music-stream void UpdateMusicStream ( Music music )                      ! Updates buffers for music streaming
1313 FUNCTION-ALIAS: stop-music-stream void StopMusicStream ( Music music )                          ! Stop music playing
1314 FUNCTION-ALIAS: pause-music-stream void PauseMusicStream ( Music music )                        ! Pause music playing
1315 FUNCTION-ALIAS: resume-music-stream void ResumeMusicStream ( Music music )                      ! Resume playing paused music
1316 FUNCTION-ALIAS: seek-music-stream void SeekMusicStream ( Music music, float position )          ! Seek music to a position (in seconds)
1317 FUNCTION-ALIAS: set-music-volume void SetMusicVolume ( Music music, float volume )              ! Set volume for music (1.0 is max level)
1318 FUNCTION-ALIAS: set-music-pitch void SetMusicPitch ( Music music, float pitch )                 ! Set pitch for a music (1.0 is base level)
1319 FUNCTION-ALIAS: get-music-time-length float GetMusicTimeLength ( Music music )                  ! Get music time length (in seconds)
1320 FUNCTION-ALIAS: get-music-time-played float GetMusicTimePlayed ( Music music )                  ! Get current music time played (in seconds)
1321
1322 ! AudioStream management functions
1323 FUNCTION-ALIAS: load-audio-stream AudioStream LoadAudioStream ( uint sampleRate, uint sampleSize, uint channels ) ! Load audio stream (to stream raw audio pcm data)
1324 FUNCTION-ALIAS: unload-audio-stream void UnloadAudioStream ( AudioStream stream )                                 ! Unload audio stream and free memory
1325 FUNCTION-ALIAS: update-audio-stream void UpdateAudioStream ( AudioStream stream, void* data, int frameCount )     ! Update audio stream buffers with data
1326 FUNCTION-ALIAS: is-audio-stream-processed bool IsAudioStreamProcessed ( AudioStream stream )                      ! Check if any audio stream buffers requires refill
1327 FUNCTION-ALIAS: play-audio-stream void PlayAudioStream ( AudioStream stream )                                     ! Play audio stream
1328 FUNCTION-ALIAS: pause-audio-stream void PauseAudioStream ( AudioStream stream )                                   ! Pause audio stream
1329 FUNCTION-ALIAS: resume-audio-stream void ResumeAudioStream ( AudioStream stream )                                 ! Resume audio stream
1330 FUNCTION-ALIAS: is-audio-stream-playing bool IsAudioStreamPlaying ( AudioStream stream )                          ! Check if audio stream is playing
1331 FUNCTION-ALIAS: stop-audio-stream void StopAudioStream ( AudioStream stream )                                     ! Stop audio stream
1332 FUNCTION-ALIAS: set-audio-stream-volume void SetAudioStreamVolume ( AudioStream stream, float volume )            ! Set volume for audio stream (1.0 is max level)
1333 FUNCTION-ALIAS: set-audio-stream-pitch void SetAudioStreamPitch ( AudioStream stream, float pitch )               ! Set pitch for audio stream (1.0 is base level)
1334 FUNCTION-ALIAS: set-audio-stream-buffer-size-default void SetAudioStreamBufferSizeDefault ( int size )            ! Default size for new audio streams
1335
1336 ! Destructors
1337 DESTRUCTOR: unload-audio-stream
1338 DESTRUCTOR: unload-file-data
1339 DESTRUCTOR: unload-file-text
1340 DESTRUCTOR: unload-font
1341 DESTRUCTOR: unload-image
1342 DESTRUCTOR: unload-image-colors
1343 DESTRUCTOR: unload-image-palette
1344 DESTRUCTOR: unload-material
1345 DESTRUCTOR: unload-mesh
1346 DESTRUCTOR: unload-model
1347 DESTRUCTOR: unload-model-animation
1348 DESTRUCTOR: unload-music-stream
1349 DESTRUCTOR: unload-render-texture
1350 DESTRUCTOR: unload-shader
1351 DESTRUCTOR: unload-sound
1352 DESTRUCTOR: unload-texture
1353 DESTRUCTOR: unload-wave
1354
1355 ! ------------------------------------------------------------------------------------
1356 ! Raygui 3.0
1357 ! ------------------------------------------------------------------------------------
1358
1359 ! Style property
1360 STRUCT: GuiStyleProp
1361     { controlId ushort }
1362     { propertyId ushort }
1363     { propertyValue int } ;
1364
1365 ! Gui control state
1366 ENUM: GuiControlState
1367     GUI_STATE_NORMAL
1368     GUI_STATE_FOCUSED
1369     GUI_STATE_PRESSED
1370     GUI_STATE_DISABLED ;
1371
1372 ! Gui control text alignment
1373 ENUM: GuiTextAlignment
1374     GUI_TEXT_ALIGN_LEFT
1375     GUI_TEXT_ALIGN_CENTER
1376     GUI_TEXT_ALIGN_RIGHT ;
1377
1378 ! Gui controls
1379 ENUM: GuiControl
1380     DEFAULT        ! Generic control -> populates to all controls when set
1381     LABEL          ! Used also for: LABELBUTTON
1382     BUTTON
1383     TOGGLE         ! Used also for: TOGGLEGROUP
1384     SLIDER         ! Used also for: SLIDERBAR
1385     PROGRESSBAR
1386     CHECKBOX
1387     COMBOBOX
1388     DROPDOWNBOX
1389     TEXTBOX        ! Used also for: TEXTBOXMULTI
1390     VALUEBOX
1391     SPINNER
1392     LISTVIEW
1393     COLORPICKER
1394     SCROLLBAR
1395     STATUSBAR ;
1396
1397 ! Gui base properties for every control
1398 ! NOTE: RAYGUI_MAX_PROPS_BASE properties (by default 16 properties)
1399 ENUM: GuiControlProperty
1400     BORDER_COLOR_NORMAL
1401     BASE_COLOR_NORMAL
1402     TEXT_COLOR_NORMAL
1403     BORDER_COLOR_FOCUSED
1404     BASE_COLOR_FOCUSED
1405     TEXT_COLOR_FOCUSED
1406     BORDER_COLOR_PRESSED
1407     BASE_COLOR_PRESSED
1408     TEXT_COLOR_PRESSED
1409     BORDER_COLOR_DISABLED
1410     BASE_COLOR_DISABLED
1411     TEXT_COLOR_DISABLED
1412     BORDER_WIDTH
1413     TEXT_PADDING
1414     TEXT_ALIGNMENT
1415     RESERVED ;
1416
1417 ! Gui extended properties depend on control
1418 ! NOTE: RAYGUI_MAX_PROPS_EXTENDED properties (by default 8 properties)
1419
1420 ! DEFAULT extended properties
1421 ! NOTE: Those properties are actually common to all controls
1422 ENUM: GuiDefaultProperty
1423     { TEXT_SIZE 16 }
1424     TEXT_SPACING
1425     LINE_COLOR
1426     BACKGROUND_COLOR ;
1427
1428 ! Toggle/ToggleGroup
1429 ENUM: GuiToggleProperty
1430     { GROUP_PADDING 16 } ;
1431
1432 ! Slider/SliderBar
1433 ENUM: GuiSliderProperty
1434     { SLIDER_WIDTH 16 }
1435     SLIDER_PADDING ;
1436
1437 ! ProgressBar
1438 ENUM: GuiProgressBarProperty
1439     { PROGRESS_PADDING 16 } ;
1440
1441 ! CheckBox
1442 ENUM: GuiCheckBoxProperty
1443     { CHECK_PADDING 16 } ;
1444
1445 ! ComboBox
1446 ENUM: GuiComboBoxProperty
1447     { COMBO_BUTTON_WIDTH 16 }
1448     COMBO_BUTTON_PADDING ;
1449
1450 ! DropdownBox
1451 ENUM: GuiDropdownBoxProperty
1452     { ARROW_PADDING 16 }
1453     DROPDOWN_ITEMS_PADDING ;
1454
1455 ! TextBox/TextBoxMulti/ValueBox/Spinner
1456 ENUM: GuiTextBoxProperty
1457     { TEXT_INNER_PADDING 16 }
1458     TEXT_LINES_PADDING
1459     COLOR_SELECTED_FG
1460     COLOR_SELECTED_BG ;
1461
1462 ! Spinner
1463 ENUM: GuiSpinnerProperty;
1464     { SPIN_BUTTON_WIDTH 16 }
1465     SPIN_BUTTON_PADDING ;
1466
1467 ! ScrollBar
1468 ENUM: GuiScrollBarProperty
1469     { ARROWS_SIZE 16 }
1470     ARROWS_VISIBLE
1471     SCROLL_SLIDER_PADDING
1472     SCROLL_SLIDER_SIZE
1473     SCROLL_PADDING
1474     SCROLL_SPEED ;
1475
1476 ! ScrollBar side
1477 ENUM: GuiScrollBarSide
1478     SCROLLBAR_LEFT_SIDE
1479     SCROLLBAR_RIGHT_SIDE ;
1480
1481 ! ListView
1482 ENUM: GuiListViewProperty
1483     { LIST_ITEMS_HEIGHT 16 }
1484     LIST_ITEMS_PADDING
1485     SCROLLBAR_WIDTH
1486     SCROLLBAR_SIDE ;
1487
1488 ! ColorPicker
1489 ENUM: GuiColorPickerProperty
1490     { COLOR_SELECTOR_SIZE 16 }
1491     HUEBAR_WIDTH                  ! Right hue bar width
1492     HUEBAR_PADDING                ! Right hue bar separation from panel
1493     HUEBAR_SELECTOR_HEIGHT        ! Right hue bar selector height
1494     HUEBAR_SELECTOR_OVERFLOW ;    ! Right hue bar selector overflow
1495
1496 ! ----------------------------------------------------------------------------------
1497 ! Module Functions Declaration
1498 ! ----------------------------------------------------------------------------------
1499
1500 ! Global gui state control functions
1501 FUNCTION-ALIAS: gui-enable void GuiEnable ( )                                           ! Enable gui controls (global state)
1502 FUNCTION-ALIAS: gui-disable void GuiDisable ( )                                         ! Disable gui controls (global state)
1503 FUNCTION-ALIAS: gui-lock void GuiLock ( )                                               ! Lock gui controls (global state)
1504 FUNCTION-ALIAS: gui-unlock void GuiUnlock ( )                                           ! Unlock gui controls (global state)
1505 FUNCTION-ALIAS: gui-is-locked bool GuiIsLocked ( )                                      ! Check if gui is locked (global state)
1506 FUNCTION-ALIAS: gui-fade void GuiFade ( float alpha )                                   ! Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
1507 FUNCTION-ALIAS: gui-set-state void GuiSetState ( int state )                            ! Set gui state (global state)
1508 FUNCTION-ALIAS: gui-get-state int GuiGetState ( )                                       ! Get gui state (global state)
1509
1510 ! Font set/get functions
1511 FUNCTION-ALIAS: gui-set-font void GuiSetFont ( Font font )                              ! Set gui custom font (global state)
1512 FUNCTION-ALIAS: gui-get-font Font GuiGetFont ( )                                        ! Get gui custom font (global state)
1513
1514 ! Style set/get functions
1515 FUNCTION-ALIAS: gui-set-style void GuiSetStyle ( int control, int property, int value ) ! Set one style property
1516 FUNCTION-ALIAS: gui-get-style int GuiGetStyle ( int control, int property )             ! Get one style property
1517
1518 ! Container/separator controls, useful for controls organization
1519 FUNCTION-ALIAS: gui-window-box bool GuiWindowBox ( Rectangle bounds, c-string title )   ! Window Box control, shows a window that can be closed
1520 FUNCTION-ALIAS: gui-group-box void GuiGroupBox ( Rectangle bounds, c-string text )      ! Group Box control with text name
1521 FUNCTION-ALIAS: gui-line void GuiLine ( Rectangle bounds, c-string text )               ! Line separator control, could contain text
1522 FUNCTION-ALIAS: gui-panel void GuiPanel ( Rectangle bounds )                            ! Panel control, useful to group controls
1523 FUNCTION-ALIAS: gui-scroll-panel Rectangle GuiScrollPanel ( Rectangle bounds, Rectangle content, Vector2* scroll ) ! Scroll Panel control
1524
1525 ! Basic controls set
1526 FUNCTION-ALIAS: gui-label void GuiLabel ( Rectangle bounds, c-string text )                                                               ! Label control, shows text
1527 FUNCTION-ALIAS: gui-button bool GuiButton ( Rectangle bounds, c-string text )                                                             ! Button control, returns true when clicked
1528 FUNCTION-ALIAS: gui-label-button bool GuiLabelButton ( Rectangle bounds, c-string text )                                                  ! Label button control, show true when clicked
1529 FUNCTION-ALIAS: gui-toggle bool GuiToggle ( Rectangle bounds, c-string text, bool active )                                                ! Toggle Button control, returns true when active
1530 FUNCTION-ALIAS: gui-toggle-group int GuiToggleGroup ( Rectangle bounds, c-string text, int active )                                       ! Toggle Group control, returns active toggle index
1531 FUNCTION-ALIAS: gui-check-box bool GuiCheckBox ( Rectangle bounds, c-string text, bool checked )                                          ! Check Box control, returns true when active
1532 FUNCTION-ALIAS: gui-combo-box int GuiComboBox ( Rectangle bounds, c-string text, int active )                                             ! Combo Box control, returns selected item index
1533 FUNCTION-ALIAS: gui-dropdown-box bool GuiDropdownBox ( Rectangle bounds, c-string text, int* active, bool editMode )                      ! Dropdown Box control, returns selected item
1534 FUNCTION-ALIAS: gui-spinner bool GuiSpinner ( Rectangle bounds, c-string text, int* value, int minValue, int maxValue, bool editMode )    ! Spinner control, returns selected value
1535 FUNCTION-ALIAS: gui-value-box bool GuiValueBox ( Rectangle bounds, c-string text, int* value, int minValue, int maxValue, bool editMode ) ! Value Box control, updates input text with numbers
1536 FUNCTION-ALIAS: gui-text-box bool GuiTextBox ( Rectangle bounds, char *text, int textSize, bool editMode )                                ! Text Box control, updates input text
1537 FUNCTION-ALIAS: gui-text-box-multi bool GuiTextBoxMulti ( Rectangle bounds, char *text, int textSize, bool editMode )                     ! Text Box control with multiple lines
1538 FUNCTION-ALIAS: gui-slider float GuiSlider ( Rectangle bounds, c-string textLeft, c-string textRight, float value, float minValue, float maxValue ) ! Slider control, returns selected value
1539 FUNCTION-ALIAS: gui-slider-bar float GuiSliderBar ( Rectangle bounds, c-string textLeft, c-string textRight, float value, float minValue, float maxValue ) ! Slider Bar control, returns selected value
1540 FUNCTION-ALIAS: gui-progress-bar float GuiProgressBar ( Rectangle bounds, c-string textLeft, c-string textRight, float value, float minValue, float maxValue ) ! Progress Bar control, shows current progress value
1541 FUNCTION-ALIAS: gui-status-bar void GuiStatusBar ( Rectangle bounds, c-string text )                                                      ! Status Bar control, shows info text
1542 FUNCTION-ALIAS: gui-dummy-rec void GuiDummyRec ( Rectangle bounds, c-string text )                                                        ! Dummy control for placeholders
1543 FUNCTION-ALIAS: gui-scroll-bar int GuiScrollBar ( Rectangle bounds, int value, int minValue, int maxValue )                               ! Scroll Bar control
1544 FUNCTION-ALIAS: gui-grid Vector2 GuiGrid ( Rectangle bounds, float spacing, int subdivs )                                                 ! Grid control
1545
1546 ! Advance controls set
1547 FUNCTION-ALIAS: gui-list-view int GuiListView ( Rectangle bounds, c-string text, int* scrollIndex, int active )                           ! List View control, returns selected list item index
1548 FUNCTION-ALIAS: gui-list-view-ex int GuiListViewEx ( Rectangle bounds, c-string* text, int count, int* focus, int* scrollIndex, int active ) ! List View with extended parameters
1549 FUNCTION-ALIAS: gui-message-box int GuiMessageBox ( Rectangle bounds, c-string title, c-string message, c-string buttons )                ! Message Box control, displays a message
1550 FUNCTION-ALIAS: gui-text-input-box int GuiTextInputBox ( Rectangle bounds, c-string title, c-string message, c-string buttons, char *text ) ! Text Input Box control, ask for text
1551 FUNCTION-ALIAS: gui-color-picker Color GuiColorPicker ( Rectangle bounds, Color color )                                                   ! Color Picker control (multiple color controls)
1552 FUNCTION-ALIAS: gui-color-panel Color GuiColorPanel ( Rectangle bounds, Color color )                                                     ! Color Panel control
1553 FUNCTION-ALIAS: gui-color-bar-alpha float GuiColorBarAlpha ( Rectangle bounds, float alpha )                                              ! Color Bar Alpha control
1554 FUNCTION-ALIAS: gui-color-bar-hue float GuiColorBarHue ( Rectangle bounds, float value )                                                  ! Color Bar Hue control
1555
1556 ! Styles loading functions
1557 FUNCTION-ALIAS: gui-load-style-(c--string void GuiLoadStyle ( c-string fileName )          ! Load style file over global style variable (.rgs)
1558 FUNCTION-ALIAS: gui-load-style-default void GuiLoadStyleDefault ( )                      ! Load style default over global style
1559
1560 FUNCTION-ALIAS: gui-icon-text c-string GuiIconText ( int iconId, c-string text )         ! Get text with icon id prepended (if supported)
1561
1562 ! Gui icons functionality
1563 FUNCTION-ALIAS: gui-draw-icon void GuiDrawIcon ( int iconId, int posX, int posY, int pixelSize, Color color )
1564
1565 FUNCTION-ALIAS: gui-get-icons uint* GuiGetIcons ( )                                      ! Get full icons data pointer
1566 FUNCTION-ALIAS: gui-get-icon-data uint* GuiGetIconData ( int iconId )                    ! Get icon bit data
1567 FUNCTION-ALIAS: gui-set-icon-data void GuiSetIconData ( int iconId, uint* data )         ! Set icon bit data
1568
1569 FUNCTION-ALIAS: gui-set-icon-pixel void GuiSetIconPixel ( int iconId, int x, int y )     ! Set icon pixel value
1570 FUNCTION-ALIAS: gui-clear-icon-pixel void GuiClearIconPixel ( int iconId, int x, int y ) ! Clear icon pixel value
1571 FUNCTION-ALIAS: gui-check-icon-pixel bool GuiCheckIconPixel ( int iconId, int x, int y ) ! Check icon pixel value