rustyray_sys/
consts.rs

1/// Mouse buttons
2#[repr(i32)]
3#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4pub enum MouseButton {
5    /// Mouse button left
6    Left,
7    /// Mouse button right
8    Right,
9    /// Mouse button middle (pressed wheel)
10    Middle,
11    /// Mouse button side (advanced mouse device)
12    Side,
13    /// Mouse button extra (advanced mouse device)
14    Extra,
15    /// Mouse button forward (advanced mouse device)
16    Forward,
17    /// Mouse button back (advanced mouse device)
18    Back,
19}
20
21/// Mouse cursor
22#[repr(i32)]
23#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24pub enum MouseCursor {
25    /// Default pointer shape
26    Default,
27    /// Arrow shape
28    Arrow,
29    /// Text writing cursor shape
30    Ibeam,
31    /// Cross shape
32    Crosshair,
33    /// Pointing hand cursor
34    PointingHand,
35    /// Horizontal resize/move arrow shape
36    ResizeEW,
37    /// Vertical resize/move arrow shape
38    ResizeNS,
39    /// Top-left to bottom-right diagonal resize/move arrow shape
40    ResizeNWSE,
41    /// Top-right to bottom-left diagonal resize/move arrow shape
42    ResizeNESW,
43    /// The omnidirectional resize/move cursor shape
44    ResizeAll,
45    /// The operation-not-allowed shape
46    NotAllowed,
47}
48
49/// Gamepad buttons
50#[repr(i32)]
51#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
52pub enum GamepadButton {
53    /// Unknown button, just for error checking
54    UNKNOWN = 0,
55    /// Gamepad left DPAD up button
56    LeftFaceUp,
57    /// Gamepad left DPAD right button
58    LeftFaceRight,
59    /// Gamepad left DPAD down button
60    LeftFaceDown,
61    /// Gamepad left DPAD left button
62    LeftFaceLeft,
63    /// Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
64    RightFaceUp,
65    /// Gamepad right button right (i.e. PS3: Circle, Xbox: B)
66    RightFaceRight,
67    /// Gamepad right button down (i.e. PS3: Cross, Xbox: A)
68    RightFaceDown,
69    /// Gamepad right button left (i.e. PS3: Square, Xbox: X)
70    RightFaceLeft,
71    /// Gamepad top/back trigger left (first), it could be a trailing button
72    LeftTrigger1,
73    /// Gamepad top/back trigger left (second), it could be a trailing button
74    LeftTrigger2,
75    /// Gamepad top/back trigger right (first), it could be a trailing button
76    RightTrigger1,
77    /// Gamepad top/back trigger right (second), it could be a trailing button
78    RightTrigger2,
79    /// Gamepad center buttons, left one (i.e. PS3: Select)
80    MiddleLeft,
81    /// Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
82    Middle,
83    /// Gamepad center buttons, right one (i.e. PS3: Start)
84    MiddleRight,
85    /// Gamepad joystick pressed button left
86    LeftThumb,
87    /// Gamepad joystick pressed button right
88    RightThumb,
89}
90
91/// Gamepad axis
92#[repr(i32)]
93#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
94pub enum GamepadAxis {
95    /// Gamepad left stick X axis
96    LeftX,
97    /// Gamepad left stick Y axis
98    LeftY,
99    /// Gamepad right stick X axis
100    RightX,
101    /// Gamepad right stick Y axis
102    RightY,
103    /// Gamepad back trigger left, pressure level: [1..-1]
104    TriggerLeft,
105    /// Gamepad back trigger right, pressure level: [1..-1]
106    TriggerRight,
107}
108
109/// Material map index
110#[repr(i32)]
111#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
112pub enum MaterialMap {
113    /// Albedo material (same as: [MATERIAL_MAP_DIFFUSE])
114    Albedo,
115    /// Metalness material (same as: [MATERIAL_MAP_SPECULAR])
116    Metalness,
117    /// Normal material
118    Normal,
119    /// Roughness material
120    Roughness,
121    /// Ambient occlusion material
122    Occlusion,
123    /// Emission material
124    Emission,
125    /// Heightmap material
126    Height,
127    /// Cubemap material (**NOTE**: Uses GL_TEXTURE_CUBE_MAP)
128    Cubemap,
129    /// Irradiance material (**NOTE**: Uses GL_TEXTURE_CUBE_MAP)
130    Irradiance,
131    /// Prefilter material (**NOTE**: Uses GL_TEXTURE_CUBE_MAP)
132    Prefilter,
133    /// BRDF material
134    BRDF,
135}
136
137pub const MATERIAL_MAP_DIFFUSE: MaterialMap = MaterialMap::Albedo;
138pub const MATERIAL_MAP_SPECULAR: MaterialMap = MaterialMap::Metalness;
139
140/// [crate::texture::Texture] parameters: filter mode
141/// - **NOTE 1**: Filtering considers mipmaps if available in the texture
142/// - **NOTE 2**: Filter is accordingly set for minification and magnification
143#[repr(i32)]
144#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
145pub enum TextureFilter {
146    /// No filter, just pixel approximation
147    Point,
148    /// Linear filtering
149    Bilinear,
150    /// Trilinear filtering (linear with mipmaps)
151    Trilinear,
152    /// Anisotropic filtering 4x
153    Anisotropic4X,
154    /// Anisotropic filtering 8x
155    Anisotropic8X,
156    /// Anisotropic filtering 16x
157    Anisotropic16X,
158}
159
160/// [crate::texture::Texture] parameters: wrap mode
161#[repr(i32)]
162#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
163pub enum TextureWrap {
164    /// Repeats [crate::texture::Texture] in tiled mode
165    Repeat,
166    /// Clamps [crate::texture::Texture] to edge pixel in tiled mode
167    Clamp,
168    /// Mirrors and repeats the [crate::texture::Texture] in tiled mode
169    MirrorRepeat,
170    /// Mirrors and clamps to border the [crate::texture::Texture] in tiled mode
171    MirrorClamp,
172}
173
174/// Font type, defines generation method
175#[repr(i32)]
176#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
177pub enum FontType {
178    /// Default font generation, anti-alised
179    Default,
180    /// Bitmap font generation, no anti-aliasing
181    Bitmap,
182    /// SDF font generation, requires external shader
183    SDF,
184}
185
186/// Color blending modes (pre-defined)
187#[repr(i32)]
188#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
189pub enum BlendMode {
190    /// Blend textures considering alpha (default)
191    Alpha,
192    /// Blend textures adding colors
193    Additive,
194    /// Blend textures multiplying colors
195    Multiplied,
196    /// Blend textures adding colors (alternative)
197    AddColors,
198    /// Blend textures subtracting colors (alternative)
199    SubtractColors,
200    /// Blend premultiplied textures considering alpha
201    AlphaPremultiply,
202    /// Blend textures using custom src/dst factors (use rlSetBlendFactors())
203    Custom,
204    /// Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())
205    CustomSeparate,
206}
207
208/// Gesture
209#[repr(u32)]
210#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
211pub enum Gesture {
212    /// No gesture
213    None,
214    /// Tap gesture
215    Tap,
216    /// Double tap gesture
217    DoubleTap,
218    /// Hold gesture
219    Hold,
220    /// Drag gesture
221    Drag,
222    /// Swipe right gesture
223    SwipeRight,
224    /// Swipe left gesture
225    SwipeLeft,
226    /// Swipe up gesture
227    SwipeUp,
228    /// Swipe down gesture
229    SwipeDown,
230    /// Pinch in gesture
231    PinchIn,
232    /// Pinch out gesture
233    PinchOut,
234}
235
236/// Camera system modes
237#[repr(i32)]
238#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
239pub enum CameraMode {
240    /// Camera custom, controlled by user ([crate::ffi::update_camera] does nothing)
241    Custom,
242    /// Camera free mode
243    Free,
244    /// Camera orbital, around target, zoom supported
245    Orbital,
246    /// Camera first person
247    FirstPerson,
248    /// Camera third person
249    ThridPerson,
250}
251
252/// Camera projection
253#[repr(i32)]
254#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
255pub enum CameraProjection {
256    /// Perspective projection
257    Perspective,
258    /// Orthographic projection
259    Orthographic,
260}
261
262/// N-patch layout
263#[repr(i32)]
264#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
265pub enum NPatchLayout {
266    /// Npatch layout: 3x3 tiles
267    NinePatch,
268    /// Npatch layout: 1x3 tiles
269    ThreePatchVertical,
270    /// Npatch layout: 3x1 tiles
271    ThreePatchHorizontal,
272}
273
274/// Trace log level
275///
276/// **NOTE**: Organized by priority level
277#[repr(i32)]
278#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
279pub enum TraceLogLevel {
280    /// Display all logs
281    All,
282    /// Trace logging, intended for interal use only
283    Trace,
284    /// Debug logging, used for internal debugging, it should be disabled on release builds
285    Debug,
286    /// Info logging, used for program execution info
287    Info,
288    /// Warning logging, used for recoverable failures
289    Warning,
290    /// Error logging, used for unrecoverable failures
291    Error,
292    /// Fatal logging, used to abort program: exit(EXIT_FAILURE)
293    Fatal,
294    /// Disable logging
295    None,
296}
297
298/// Keyboard keys (US keyboard layout)
299///
300/// **NOTE**: Use [crate::ffi::get_key_pressed] to allow redefining
301/// required keys for alternative layouts
302#[repr(i32)]
303#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
304pub enum KeyboardKey {
305    /// Key: NULL, used for no key pressed
306    Null = 0,
307    // Alphanumeric keys
308    /// Key: `'`
309    Apostrophe = 39,
310    /// Key: `,`
311    Comma = 44,
312    /// Key: `-`
313    Minus = 45,
314    /// Key: `.`
315    Period = 46,
316    /// Key: `/`
317    Slash = 47,
318    /// Key: `0`
319    Zero = 48,
320    /// Key: `1`
321    One = 49,
322    /// Key: `2`
323    Two = 50,
324    /// Key: `3`
325    Three = 51,
326    /// Key: `4`
327    Four = 52,
328    /// Key: `5`
329    Five = 53,
330    /// Key: `6`
331    Six = 54,
332    /// Key: `7`
333    Seven = 55,
334    /// Key: `8`
335    Eight = 56,
336    /// Key: `9`
337    Nine = 57,
338    /// Key: `;`
339    Semicolon = 59,
340    /// Key: `=`
341    Equal = 61,
342    /// Key: `A` | `a`
343    A = 65,
344    /// Key: `B` | `b`
345    B = 66,
346    /// Key: `C` | `c`
347    C = 67,
348    /// Key: `D` | `d`
349    D = 68,
350    /// Key: `E` | `e`
351    E = 69,
352    /// Key: `F` | `f`
353    F = 70,
354    /// Key: `G` | `g`
355    G = 71,
356    /// Key: `H` | `h`
357    H = 72,
358    /// Key: `I` | `i`
359    I = 73,
360    /// Key: `J` | `j`
361    J = 74,
362    /// Key: `K` | `k`
363    K = 75,
364    /// Key: `L` | `l`
365    L = 76,
366    /// Key: `M` | `m`
367    M = 77,
368    /// Key: `N` | `n`
369    N = 78,
370    /// Key: `O` | `o`
371    O = 79,
372    /// Key: `P` | `p`
373    P = 80,
374    /// Key: `Q` | `q`
375    Q = 81,
376    /// Key: `R` | `r`
377    R = 82,
378    /// Key: `S` | `s`
379    S = 83,
380    /// Key: `T` | `t`
381    T = 84,
382    /// Key: `U` | `u`
383    U = 85,
384    /// Key: `V` | `v`
385    V = 86,
386    /// Key: `W` | `w`
387    W = 87,
388    /// Key: `X` | `x`
389    X = 88,
390    /// Key: `Y` | `y`
391    Y = 89,
392    /// Key: `Z` | `z`
393    Z = 90,
394    /// Key: `[`
395    LeftBracket = 91,
396    /// Key: `\`
397    Backslash = 92,
398    /// Key: `]`
399    RightBracket = 93,
400    /// Key  `\``
401    Grave = 96,
402    // Function keys
403    /// Key: `Space`
404    Space = 32,
405    /// Key: `Esc`
406    Escape = 256,
407    /// Key: `Enter`
408    Enter = 257,
409    /// Key: `Tab`
410    Tab = 258,
411    /// Key: `Backspace`
412    Backspace = 259,
413    /// Key: `Ins`
414    Insert = 260,
415    /// Key: `Del`
416    Delete = 261,
417    /// Key: `Cursor right`
418    Right = 262,
419    /// Key: `Cursor left`
420    Left = 263,
421    /// Key: `Cursor down`
422    Down = 264,
423    /// Key: `Cursor up`
424    Up = 265,
425    /// Key: `Page up`
426    PageUp = 266,
427    /// Key: `Page down`
428    PageDown = 267,
429    /// Key: `Home`
430    Home = 268,
431    /// Key: `End`
432    End = 269,
433    /// Key: `Caps lock`
434    CapsLock = 280,
435    /// Key: `Scroll lock`
436    ScrollLock = 281,
437    /// Key: `Num lock`
438    NumLock = 282,
439    /// Key: `Print screen`
440    PrintScreen = 283,
441    /// Key: `Pause`
442    Pause = 284,
443    /// Key: `F1`
444    F1 = 290,
445    /// Key: `F2`
446    F2 = 291,
447    /// Key: `F3`
448    F3 = 292,
449    /// Key: `F4`
450    F4 = 293,
451    /// Key: `F5`
452    F5 = 294,
453    /// Key: `F6`
454    F6 = 295,
455    /// Key: `F7`
456    F7 = 296,
457    /// Key: `F8`
458    F8 = 297,
459    /// Key: `F9`
460    F9 = 298,
461    /// Key: `F10`
462    F10 = 299,
463    /// Key: `F11`
464    F11 = 300,
465    /// Key: `F12`
466    F12 = 301,
467    /// Key: `Shift left`
468    LeftShift = 340,
469    /// Key: `Control left`
470    LeftControl = 341,
471    /// Key: `Alt left`
472    LeftAlt = 342,
473    /// Key: `Super left`
474    LeftSuper = 343,
475    /// Key: `Shift right`
476    RightShift = 344,
477    /// Key: `Control right`
478    RightControl = 345,
479    /// Key: `Alt right`
480    RightAlt = 346,
481    /// Key: `Super right`
482    RightSuper = 347,
483    /// Key: `KB menu`
484    KBMenu = 348,
485    // Keypad keys
486    /// Key: `Keypad 0`
487    KP0 = 320,
488    /// Key: `Keypad 1`
489    KP1 = 321,
490    /// Key: `Keypad 2`
491    KP2 = 322,
492    /// Key: `Keypad 3`
493    KP3 = 323,
494    /// Key: `Keypad 4`
495    KP4 = 324,
496    /// Key: `Keypad 5`
497    KP5 = 325,
498    /// Key: `Keypad 6`
499    KP6 = 326,
500    /// Key: `Keypad 7`
501    KP7 = 327,
502    /// Key: `Keypad 8`
503    KP8 = 328,
504    /// Key: `Keypad 9`
505    KP9 = 329,
506    /// Key: `Keypad .`
507    KPDecimal = 330,
508    /// Key: `Keypad /`
509    KPDivide = 331,
510    /// Key: `Keypad *`
511    KPMultiply = 332,
512    /// Key: `Keypad -`
513    KPSubtract = 333,
514    /// Key: `Keypad +`
515    KPAdd = 334,
516    /// Key: `Keypad Enter`
517    KPEnter = 335,
518    /// Key: `Keypad =`
519    KPEqual = 336,
520    // Android key button
521    /// Key: `Android back button`
522    Back = 4,
523    /// Key: `Android menu button`
524    Menu = 5,
525    /// Key: `Android volume up button`
526    VolumeUp = 24,
527    /// Key: `Android volume down button`
528    VolumeDown = 25,
529}
530
531/// System/Window config flags
532///
533/// **NOTE**: Every bit registers one state (use it with bit masks)
534///
535/// By default all flags are set to `0`
536#[repr(i32)]
537#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
538pub enum ConfigFlag {
539    /// Set to try enabling V-Sync on GPU
540    VsyncHint = 0x00000040,
541    /// Set to run program in fullscreen
542    FullscreenMode = 0x00000002,
543    /// Set to allow resizable window
544    WindowResizable = 0x00000004,
545    /// Set to disable window decoration (frame and buttons)
546    WindowUndecorated = 0x00000008,
547    /// Set to hide window
548    WindowHidden = 0x00000080,
549    /// Set to minimize window (iconify)
550    WindowMinimized = 0x00000200,
551    /// Set to maximize window (expanded to monitor)
552    WindowMaximized = 0x00000400,
553    /// Set to window non focused
554    WindowUnfocused = 0x00000800,
555    /// Set to window always on top
556    WindowTopmost = 0x00001000,
557    /// Set to allow windows running while
558    WindowAlwaysRun = 0x00000100,
559    /// Set to allow transparent framebuffer
560    WindowTransparent = 0x00000010,
561    /// Set to support HighDPI
562    WindowHighdpi = 0x00002000,
563    /// Set to support mouse passthrough, only supported when [ConfigFlag::WindowUndecorated]
564    WindowMousePassthrough = 0x00004000,
565    /// Set to run program in borderless windowed mode
566    BorderlessWindowedMode = 0x00008000,
567    /// Set to try enabling MSAA 4X
568    Msaa4xHint = 0x00000020,
569    /// Set to try enabling interlaced video format (for V3D)
570    InterlacedHint = 0x00010000,
571}