raylib_wasm/shared/enums.rs
1/// System/Window config flags
2#[repr(C)]
3#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4pub enum ConfigFlags {
5 /// Set to try enabling V-Sync on GPU
6 VsyncHint = 64,
7 /// Set to run program in fullscreen
8 FullscreenMode = 2,
9 /// Set to allow resizable window
10 WindowResizable = 4,
11 /// Set to disable window decoration (frame and buttons)
12 WindowUndecorated = 8,
13 /// Set to hide window
14 WindowHidden = 128,
15 /// Set to minimize window (iconify)
16 WindowMinimized = 512,
17 /// Set to maximize window (expanded to monitor)
18 WindowMaximized = 1024,
19 /// Set to window non focused
20 WindowUnfocused = 2048,
21 /// Set to window always on top
22 WindowTopmost = 4096,
23 /// Set to allow windows running while minimized
24 WindowAlwaysRun = 256,
25 /// Set to allow transparent framebuffer
26 WindowTransparent = 16,
27 /// Set to support HighDPI
28 WindowHighdpi = 8192,
29 /// Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
30 WindowMousePassthrough = 16384,
31 /// Set to run program in borderless windowed mode
32 BorderlessWindowedMode = 32768,
33 /// Set to try enabling MSAA 4X
34 Msaa4xHint = 32,
35 /// Set to try enabling interlaced video format (for V3D)
36 InterlacedHint = 65536,
37}
38
39/// Trace log level
40#[repr(C)]
41#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
42pub enum TraceLogLevel {
43 /// Display all logs
44 All = 0,
45 /// Trace logging, intended for internal use only
46 Trace = 1,
47 /// Debug logging, used for internal debugging, it should be disabled on release builds
48 Debug = 2,
49 /// Info logging, used for program execution info
50 Info = 3,
51 /// Warning logging, used on recoverable failures
52 Warning = 4,
53 /// Error logging, used on unrecoverable failures
54 Error = 5,
55 /// Fatal logging, used to abort program: exit(EXIT_FAILURE)
56 Fatal = 6,
57 /// Disable logging
58 None = 7,
59}
60
61/// Keyboard keys (US keyboard layout)
62#[repr(C)]
63#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
64pub enum KeyboardKey {
65 /// Key: NULL, used for no key pressed
66 Null = 0,
67 /// Key: '
68 Apostrophe = 39,
69 /// Key: ,
70 Comma = 44,
71 /// Key: -
72 Minus = 45,
73 /// Key: .
74 Period = 46,
75 /// Key: /
76 Slash = 47,
77 /// Key: 0
78 Zero = 48,
79 /// Key: 1
80 One = 49,
81 /// Key: 2
82 Two = 50,
83 /// Key: 3
84 Three = 51,
85 /// Key: 4
86 Four = 52,
87 /// Key: 5
88 Five = 53,
89 /// Key: 6
90 Six = 54,
91 /// Key: 7
92 Seven = 55,
93 /// Key: 8
94 Eight = 56,
95 /// Key: 9
96 Nine = 57,
97 /// Key: ;
98 Semicolon = 59,
99 /// Key: =
100 Equal = 61,
101 /// Key: A | a
102 A = 65,
103 /// Key: B | b
104 B = 66,
105 /// Key: C | c
106 C = 67,
107 /// Key: D | d
108 D = 68,
109 /// Key: E | e
110 E = 69,
111 /// Key: F | f
112 F = 70,
113 /// Key: G | g
114 G = 71,
115 /// Key: H | h
116 H = 72,
117 /// Key: I | i
118 I = 73,
119 /// Key: J | j
120 J = 74,
121 /// Key: K | k
122 K = 75,
123 /// Key: L | l
124 L = 76,
125 /// Key: M | m
126 M = 77,
127 /// Key: N | n
128 N = 78,
129 /// Key: O | o
130 O = 79,
131 /// Key: P | p
132 P = 80,
133 /// Key: Q | q
134 Q = 81,
135 /// Key: R | r
136 R = 82,
137 /// Key: S | s
138 S = 83,
139 /// Key: T | t
140 T = 84,
141 /// Key: U | u
142 U = 85,
143 /// Key: V | v
144 V = 86,
145 /// Key: W | w
146 W = 87,
147 /// Key: X | x
148 X = 88,
149 /// Key: Y | y
150 Y = 89,
151 /// Key: Z | z
152 Z = 90,
153 /// Key: [
154 LeftBracket = 91,
155 /// Key: '\'
156 Backslash = 92,
157 /// Key: ]
158 RightBracket = 93,
159 /// Key: `
160 Grave = 96,
161 /// Key: Space
162 Space = 32,
163 /// Key: Esc
164 Escape = 256,
165 /// Key: Enter
166 Enter = 257,
167 /// Key: Tab
168 Tab = 258,
169 /// Key: Backspace
170 Backspace = 259,
171 /// Key: Ins
172 Insert = 260,
173 /// Key: Del
174 Delete = 261,
175 /// Key: Cursor right
176 Right = 262,
177 /// Key: Cursor left
178 Left = 263,
179 /// Key: Cursor down
180 Down = 264,
181 /// Key: Cursor up
182 Up = 265,
183 /// Key: Page up
184 PageUp = 266,
185 /// Key: Page down
186 PageDown = 267,
187 /// Key: Home
188 Home = 268,
189 /// Key: End
190 End = 269,
191 /// Key: Caps lock
192 CapsLock = 280,
193 /// Key: Scroll down
194 ScrollLock = 281,
195 /// Key: Num lock
196 NumLock = 282,
197 /// Key: Print screen
198 PrintScreen = 283,
199 /// Key: Pause
200 Pause = 284,
201 /// Key: F1
202 F1 = 290,
203 /// Key: F2
204 F2 = 291,
205 /// Key: F3
206 F3 = 292,
207 /// Key: F4
208 F4 = 293,
209 /// Key: F5
210 F5 = 294,
211 /// Key: F6
212 F6 = 295,
213 /// Key: F7
214 F7 = 296,
215 /// Key: F8
216 F8 = 297,
217 /// Key: F9
218 F9 = 298,
219 /// Key: F10
220 F10 = 299,
221 /// Key: F11
222 F11 = 300,
223 /// Key: F12
224 F12 = 301,
225 /// Key: Shift left
226 LeftShift = 340,
227 /// Key: Control left
228 LeftControl = 341,
229 /// Key: Alt left
230 LeftAlt = 342,
231 /// Key: Super left
232 LeftSuper = 343,
233 /// Key: Shift right
234 RightShift = 344,
235 /// Key: Control right
236 RightControl = 345,
237 /// Key: Alt right
238 RightAlt = 346,
239 /// Key: Super right
240 RightSuper = 347,
241 /// Key: KB menu
242 KbMenu = 348,
243 /// Key: Keypad 0
244 Kp0 = 320,
245 /// Key: Keypad 1
246 Kp1 = 321,
247 /// Key: Keypad 2
248 Kp2 = 322,
249 /// Key: Keypad 3
250 Kp3 = 323,
251 /// Key: Keypad 4
252 Kp4 = 324,
253 /// Key: Keypad 5
254 Kp5 = 325,
255 /// Key: Keypad 6
256 Kp6 = 326,
257 /// Key: Keypad 7
258 Kp7 = 327,
259 /// Key: Keypad 8
260 Kp8 = 328,
261 /// Key: Keypad 9
262 Kp9 = 329,
263 /// Key: Keypad .
264 KpDecimal = 330,
265 /// Key: Keypad /
266 KpDivide = 331,
267 /// Key: Keypad *
268 KpMultiply = 332,
269 /// Key: Keypad -
270 KpSubtract = 333,
271 /// Key: Keypad +
272 KpAdd = 334,
273 /// Key: Keypad Enter
274 KpEnter = 335,
275 /// Key: Keypad =
276 KpEqual = 336,
277 /// Key: Android back button
278 Back = 4,
279 /// Key: Android volume up button
280 VolumeUp = 24,
281 /// Key: Android volume down button
282 VolumeDown = 25,
283}
284
285/// Mouse buttons
286#[repr(C)]
287#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
288pub enum MouseButton {
289 /// Mouse button left
290 Left = 0,
291 /// Mouse button right
292 Right = 1,
293 /// Mouse button middle (pressed wheel)
294 Middle = 2,
295 /// Mouse button side (advanced mouse device)
296 Side = 3,
297 /// Mouse button extra (advanced mouse device)
298 Extra = 4,
299 /// Mouse button forward (advanced mouse device)
300 Forward = 5,
301 /// Mouse button back (advanced mouse device)
302 Back = 6,
303}
304
305/// Mouse cursor
306#[repr(C)]
307#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
308pub enum MouseCursor {
309 /// Default pointer shape
310 Default = 0,
311 /// Arrow shape
312 Arrow = 1,
313 /// Text writing cursor shape
314 Ibeam = 2,
315 /// Cross shape
316 Crosshair = 3,
317 /// Pointing hand cursor
318 PointingHand = 4,
319 /// Horizontal resize/move arrow shape
320 ResizeEw = 5,
321 /// Vertical resize/move arrow shape
322 ResizeNs = 6,
323 /// Top-left to bottom-right diagonal resize/move arrow shape
324 ResizeNwse = 7,
325 /// The top-right to bottom-left diagonal resize/move arrow shape
326 ResizeNesw = 8,
327 /// The omnidirectional resize/move cursor shape
328 ResizeAll = 9,
329 /// The operation-not-allowed shape
330 NotAllowed = 10,
331}
332
333/// Gamepad buttons
334#[repr(C)]
335#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
336pub enum GamepadButton {
337 /// Unknown button, just for error checking
338 Unknown = 0,
339 /// Gamepad left DPAD up button
340 LeftFaceUp = 1,
341 /// Gamepad left DPAD right button
342 LeftFaceRight = 2,
343 /// Gamepad left DPAD down button
344 LeftFaceDown = 3,
345 /// Gamepad left DPAD left button
346 LeftFaceLeft = 4,
347 /// Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
348 RightFaceUp = 5,
349 /// Gamepad right button right (i.e. PS3: Square, Xbox: X)
350 RightFaceRight = 6,
351 /// Gamepad right button down (i.e. PS3: Cross, Xbox: A)
352 RightFaceDown = 7,
353 /// Gamepad right button left (i.e. PS3: Circle, Xbox: B)
354 RightFaceLeft = 8,
355 /// Gamepad top/back trigger left (first), it could be a trailing button
356 LeftTrigger1 = 9,
357 /// Gamepad top/back trigger left (second), it could be a trailing button
358 LeftTrigger2 = 10,
359 /// Gamepad top/back trigger right (one), it could be a trailing button
360 RightTrigger1 = 11,
361 /// Gamepad top/back trigger right (second), it could be a trailing button
362 RightTrigger2 = 12,
363 /// Gamepad center buttons, left one (i.e. PS3: Select)
364 MiddleLeft = 13,
365 /// Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
366 Middle = 14,
367 /// Gamepad center buttons, right one (i.e. PS3: Start)
368 MiddleRight = 15,
369 /// Gamepad joystick pressed button left
370 LeftThumb = 16,
371 /// Gamepad joystick pressed button right
372 RightThumb = 17,
373}
374
375/// Gamepad axis
376#[repr(C)]
377#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
378pub enum GamepadAxis {
379 /// Gamepad left stick X axis
380 LeftX = 0,
381 /// Gamepad left stick Y axis
382 LeftY = 1,
383 /// Gamepad right stick X axis
384 RightX = 2,
385 /// Gamepad right stick Y axis
386 RightY = 3,
387 /// Gamepad back trigger left, pressure level: [1..-1]
388 LeftTrigger = 4,
389 /// Gamepad back trigger right, pressure level: [1..-1]
390 RightTrigger = 5,
391}
392
393/// Material map index
394#[repr(C)]
395#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
396pub enum MaterialMapIndex {
397 /// Albedo material (same as: MATERIAL_MAP_DIFFUSE)
398 Albedo = 0,
399 /// Metalness material (same as: MATERIAL_MAP_SPECULAR)
400 Metalness = 1,
401 /// Normal material
402 Normal = 2,
403 /// Roughness material
404 Roughness = 3,
405 /// Ambient occlusion material
406 Occlusion = 4,
407 /// Emission material
408 Emission = 5,
409 /// Heightmap material
410 Height = 6,
411 /// Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
412 Cubemap = 7,
413 /// Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
414 Irradiance = 8,
415 /// Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
416 Prefilter = 9,
417 /// Brdf material
418 Brdf = 10,
419}
420
421/// Shader location index
422#[repr(C)]
423#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
424pub enum ShaderLocationIndex {
425 /// Shader location: vertex attribute: position
426 VertexPosition = 0,
427 /// Shader location: vertex attribute: texcoord01
428 VertexTexcoord01 = 1,
429 /// Shader location: vertex attribute: texcoord02
430 VertexTexcoord02 = 2,
431 /// Shader location: vertex attribute: normal
432 VertexNormal = 3,
433 /// Shader location: vertex attribute: tangent
434 VertexTangent = 4,
435 /// Shader location: vertex attribute: color
436 VertexColor = 5,
437 /// Shader location: matrix uniform: model-view-projection
438 MatrixMvp = 6,
439 /// Shader location: matrix uniform: view (camera transform)
440 MatrixView = 7,
441 /// Shader location: matrix uniform: projection
442 MatrixProjection = 8,
443 /// Shader location: matrix uniform: model (transform)
444 MatrixModel = 9,
445 /// Shader location: matrix uniform: normal
446 MatrixNormal = 10,
447 /// Shader location: vector uniform: view
448 VectorView = 11,
449 /// Shader location: vector uniform: diffuse color
450 ColorDiffuse = 12,
451 /// Shader location: vector uniform: specular color
452 ColorSpecular = 13,
453 /// Shader location: vector uniform: ambient color
454 ColorAmbient = 14,
455 /// Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE)
456 MapAlbedo = 15,
457 /// Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR)
458 MapMetalness = 16,
459 /// Shader location: sampler2d texture: normal
460 MapNormal = 17,
461 /// Shader location: sampler2d texture: roughness
462 MapRoughness = 18,
463 /// Shader location: sampler2d texture: occlusion
464 MapOcclusion = 19,
465 /// Shader location: sampler2d texture: emission
466 MapEmission = 20,
467 /// Shader location: sampler2d texture: height
468 MapHeight = 21,
469 /// Shader location: samplerCube texture: cubemap
470 MapCubemap = 22,
471 /// Shader location: samplerCube texture: irradiance
472 MapIrradiance = 23,
473 /// Shader location: samplerCube texture: prefilter
474 MapPrefilter = 24,
475 /// Shader location: sampler2d texture: brdf
476 MapBrdf = 25,
477}
478
479/// Shader uniform data type
480#[repr(C)]
481#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
482pub enum ShaderUniformDataType {
483 /// Shader uniform type: float
484 Float = 0,
485 /// Shader uniform type: vec2 (2 float)
486 Vec2 = 1,
487 /// Shader uniform type: vec3 (3 float)
488 Vec3 = 2,
489 /// Shader uniform type: vec4 (4 float)
490 Vec4 = 3,
491 /// Shader uniform type: int
492 Int = 4,
493 /// Shader uniform type: ivec2 (2 int)
494 Ivec2 = 5,
495 /// Shader uniform type: ivec3 (3 int)
496 Ivec3 = 6,
497 /// Shader uniform type: ivec4 (4 int)
498 Ivec4 = 7,
499 /// Shader uniform type: sampler2d
500 Sampler2d = 8,
501}
502
503/// Shader attribute data types
504#[repr(C)]
505#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
506pub enum ShaderAttributeDataType {
507 /// Shader attribute type: float
508 Float = 0,
509 /// Shader attribute type: vec2 (2 float)
510 Vec2 = 1,
511 /// Shader attribute type: vec3 (3 float)
512 Vec3 = 2,
513 /// Shader attribute type: vec4 (4 float)
514 Vec4 = 3,
515}
516
517/// Pixel formats
518#[repr(C)]
519#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
520pub enum PixelFormat {
521 /// 8 bit per pixel (no alpha)
522 Grayscale = 1,
523 /// 8*2 bpp (2 channels)
524 GrayAlpha = 2,
525 /// 16 bpp
526 R5g6b5 = 3,
527 /// 24 bpp
528 R8g8b8 = 4,
529 /// 16 bpp (1 bit alpha)
530 R5g5b5a1 = 5,
531 /// 16 bpp (4 bit alpha)
532 R4g4b4a4 = 6,
533 /// 32 bpp
534 R8g8b8a8 = 7,
535 /// 32 bpp (1 channel - float)
536 R32 = 8,
537 /// 32*3 bpp (3 channels - float)
538 R32g32b32 = 9,
539 /// 32*4 bpp (4 channels - float)
540 R32g32b32a32 = 10,
541 /// 16 bpp (1 channel - half float)
542 R16 = 11,
543 /// 16*3 bpp (3 channels - half float)
544 R16g16b16 = 12,
545 /// 16*4 bpp (4 channels - half float)
546 R16g16b16a16 = 13,
547 /// 4 bpp (no alpha)
548 Dxt1Rgb = 14,
549 /// 4 bpp (1 bit alpha)
550 Dxt1Rgba = 15,
551 /// 8 bpp
552 Dxt3Rgba = 16,
553 /// 8 bpp
554 Dxt5Rgba = 17,
555 /// 4 bpp
556 Etc1Rgb = 18,
557 /// 4 bpp
558 Etc2Rgb = 19,
559 /// 8 bpp
560 Etc2EacRgba = 20,
561 /// 4 bpp
562 PvrtRgb = 21,
563 /// 4 bpp
564 PvrtRgba = 22,
565 /// 8 bpp
566 Astc4x4Rgba = 23,
567 /// 2 bpp
568 Astc8x8Rgba = 24,
569}
570
571/// Texture parameters: filter mode
572#[repr(C)]
573#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
574pub enum TextureFilter {
575 /// No filter, just pixel approximation
576 Point = 0,
577 /// Linear filtering
578 Bilinear = 1,
579 /// Trilinear filtering (linear with mipmaps)
580 Trilinear = 2,
581 /// Anisotropic filtering 4x
582 Anisotropic4x = 3,
583 /// Anisotropic filtering 8x
584 Anisotropic8x = 4,
585 /// Anisotropic filtering 16x
586 Anisotropic16x = 5,
587}
588
589/// Texture parameters: wrap mode
590#[repr(C)]
591#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
592pub enum TextureWrap {
593 /// Repeats texture in tiled mode
594 Repeat = 0,
595 /// Clamps texture to edge pixel in tiled mode
596 Clamp = 1,
597 /// Mirrors and repeats the texture in tiled mode
598 MirrorRepeat = 2,
599 /// Mirrors and clamps to border the texture in tiled mode
600 MirrorClamp = 3,
601}
602
603/// Cubemap layouts
604#[repr(C)]
605#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
606pub enum CubemapLayout {
607 /// Automatically detect layout type
608 AutoDetect = 0,
609 /// Layout is defined by a vertical line with faces
610 LineVertical = 1,
611 /// Layout is defined by a horizontal line with faces
612 LineHorizontal = 2,
613 /// Layout is defined by a 3x4 cross with cubemap faces
614 CrossThreeByFour = 3,
615 /// Layout is defined by a 4x3 cross with cubemap faces
616 CrossFourByThree = 4,
617 /// Layout is defined by a panorama image (equirrectangular map)
618 Panorama = 5,
619}
620
621/// Font type, defines generation method
622#[repr(C)]
623#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
624pub enum FontType {
625 /// Default font generation, anti-aliased
626 Default = 0,
627 /// Bitmap font generation, no anti-aliasing
628 Bitmap = 1,
629 /// SDF font generation, requires external shader
630 Sdf = 2,
631}
632
633/// Color blending modes (pre-defined)
634#[repr(C)]
635#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
636pub enum BlendMode {
637 /// Blend textures considering alpha (default)
638 Alpha = 0,
639 /// Blend textures adding colors
640 Additive = 1,
641 /// Blend textures multiplying colors
642 Multiplied = 2,
643 /// Blend textures adding colors (alternative)
644 AddColors = 3,
645 /// Blend textures subtracting colors (alternative)
646 SubtractColors = 4,
647 /// Blend premultiplied textures considering alpha
648 AlphaPremultiply = 5,
649 /// Blend textures using custom src/dst factors (use rlSetBlendFactors())
650 Custom = 6,
651 /// Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())
652 CustomSeparate = 7,
653}
654
655/// Gesture
656#[repr(C)]
657#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
658pub enum Gesture {
659 /// No gesture
660 None = 0,
661 /// Tap gesture
662 Tap = 1,
663 /// Double tap gesture
664 Doubletap = 2,
665 /// Hold gesture
666 Hold = 4,
667 /// Drag gesture
668 Drag = 8,
669 /// Swipe right gesture
670 SwipeRight = 16,
671 /// Swipe left gesture
672 SwipeLeft = 32,
673 /// Swipe up gesture
674 SwipeUp = 64,
675 /// Swipe down gesture
676 SwipeDown = 128,
677 /// Pinch in gesture
678 PinchIn = 256,
679 /// Pinch out gesture
680 PinchOut = 512,
681}
682
683/// Camera system modes
684#[repr(C)]
685#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
686pub enum CameraMode {
687 /// Custom camera
688 Custom = 0,
689 /// Free camera
690 Free = 1,
691 /// Orbital camera
692 Orbital = 2,
693 /// First person camera
694 FirstPerson = 3,
695 /// Third person camera
696 ThirdPerson = 4,
697}
698
699/// Camera projection
700#[repr(C)]
701#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
702pub enum CameraProjection {
703 /// Perspective projection
704 Perspective = 0,
705 /// Orthographic projection
706 Orthographic = 1,
707}
708
709/// N-patch layout
710#[repr(C)]
711#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
712pub enum NPatchLayout {
713 /// Npatch layout: 3x3 tiles
714 NinePatch = 0,
715 /// Npatch layout: 1x3 tiles
716 ThreePatchVertical = 1,
717 /// Npatch layout: 3x1 tiles
718 ThreePatchHorizontal = 2,
719}