Skip to content

raylib enumerated types

Antonis Geralis edited this page Sep 25, 2022 · 8 revisions

raylib provides some enumerated types to be used in some functions. You probably noticed that despite being typedef, there is no function referring to those enum types, all related parameters are just defined as int. This is a design decision and the reason for that is because those enums just intend to be a way to organize similar values definition, I use enums instead of plain defines. You can notice that because there is no enum intended to create variables of that type, just to be used as defined values. Maybe I review this decision in a future.

Here it is the list with the provided enums and the functions intended to use them.

enum ConfigFlags

    SetConfigFlags(unsigned int flags);
    SetWindowState(unsigned int flags);
    ClearWindowState(unsigned int flags);
    IsWindowState(unsigned int flag); 

enum TraceLogLevel

    TraceLog(int logLevel, const char *text, ...);
    SetTraceLogLevel(int logLevel);

enum KeyboardKey

    IsKeyPressed(int key);
    IsKeyDown(int key);
    IsKeyReleased(int key);
    IsKeyUp(int key);
    SetExitKey(int key);
    //GetKeyPressed(void);
    SetCameraAltControl(int keyAlt);
    SetCameraSmoothZoomControl(int keySmoothZoom);
    SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown);

enum MouseButton

    IsMouseButtonPressed(int button);
    IsMouseButtonDown(int button);
    IsMouseButtonReleased(int button);
    IsMouseButtonUp(int button);
    SetCameraPanControl(int keyPan);

enum MouseCursor

    SetMouseCursor(int cursor);

enum GamepadButton

    IsGamepadButtonPressed(int gamepad, int button);
    IsGamepadButtonDown(int gamepad, int button);
    IsGamepadButtonReleased(int gamepad, int button);
    IsGamepadButtonUp(int gamepad, int button);
    //GetGamepadButtonPressed(void);

enum GamepadAxis

    GetGamepadAxisMovement(int gamepad, int axis);

enum ShaderLocationIndex

    struct Shader.locs[index]

enum ShaderUniformDataType

    SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType);
    SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count);

enum MaterialMapIndex

    struct Material.maps[index]

enum PixelFormat

    struct Image.format
    struct Texture.format
    LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize);
    ImageFormat(Image *image, int newFormat);

enum TextureFilter

    SetTextureFilter(Texture2D texture, int filter);

enum TextureWrap

    SetTextureWrap(Texture2D texture, int wrap);

enum CubemapLayout

    LoadTextureCubemap(Image image, int layout);

enum FontType

    LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount, int type);

enum BlendMode

    BeginBlendMode(int mode);

enum Gesture

    SetGesturesEnabled(unsigned int flags);
    IsGestureDetected(int gesture);
    //GetGestureDetected(void);

enum CameraMode

    SetCameraMode(Camera camera, int mode);

enum CameraProjection

    struct Camera3D.projection

enum NPatchLayout

    struct nPatchInfo.layout

I hope this list could be helpful!

Clone this wiki locally