#ifndef RAYLIB_H
#define RAYLIB_H
#include <stdarg.h>
#if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED)
#define RLAPI __declspec(dllexport)
#elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED)
#define RLAPI __declspec(dllimport)
#else
#define RLAPI
#endif
#ifndef PI
#define PI 3.14159265358979323846f
#endif
#define DEG2RAD (PI / 180.0f)
#define RAD2DEG (180.0f / PI)
#define MAX_TOUCH_POINTS 10
#define MAX_SHADER_LOCATIONS 32
#define MAX_MATERIAL_MAPS 12
#ifndef RL_MALLOC
#define RL_MALLOC(sz) malloc(sz)
#endif
#ifndef RL_CALLOC
#define RL_CALLOC(n, sz) calloc(n, sz)
#endif
#ifndef RL_FREE
#define RL_FREE(p) free(p)
#endif
#if defined(__cplusplus)
#define CLITERAL
#else
#define CLITERAL (Color)
#endif
#define LIGHTGRAY \
CLITERAL { 200, 200, 200, 255 } #define GRAY \
CLITERAL { 130, 130, 130, 255 } #define DARKGRAY \
CLITERAL { 80, 80, 80, 255 } #define YELLOW \
CLITERAL { 253, 249, 0, 255 } #define GOLD \
CLITERAL { 255, 203, 0, 255 } #define ORANGE \
CLITERAL { 255, 161, 0, 255 } #define PINK \
CLITERAL { 255, 109, 194, 255 } #define RED \
CLITERAL { 230, 41, 55, 255 } #define MAROON \
CLITERAL { 190, 33, 55, 255 } #define GREEN \
CLITERAL { 0, 228, 48, 255 } #define LIME \
CLITERAL { 0, 158, 47, 255 } #define DARKGREEN \
CLITERAL { 0, 117, 44, 255 } #define SKYBLUE \
CLITERAL { 102, 191, 255, 255 } #define BLUE \
CLITERAL { 0, 121, 241, 255 } #define DARKBLUE \
CLITERAL { 0, 82, 172, 255 } #define PURPLE \
CLITERAL { 200, 122, 255, 255 } #define VIOLET \
CLITERAL { 135, 60, 190, 255 } #define DARKPURPLE \
CLITERAL { 112, 31, 126, 255 } #define BEIGE \
CLITERAL { 211, 176, 131, 255 } #define BROWN \
CLITERAL { 127, 106, 79, 255 } #define DARKBROWN \
CLITERAL { 76, 63, 47, 255 }
#define WHITE \
CLITERAL { 255, 255, 255, 255 } #define BLACK \
CLITERAL { 0, 0, 0, 255 } #define BLANK \
CLITERAL { 0, 0, 0, 0 } #define MAGENTA \
CLITERAL { 255, 0, 255, 255 } #define RAYWHITE \
CLITERAL { 245, 245, 245, 255 }
#define FormatText TextFormat
#define SubText TextSubtext
#define ShowWindow UnhideWindow
#if defined(__STDC__) && __STDC_VERSION__ >= 199901L
#include <stdbool.h>
#elif !defined(__cplusplus) && !defined(bool)
typedef enum
{
false,
true
} bool;
#endif
typedef struct Vector2
{
float x;
float y;
} Vector2;
typedef struct Vector3
{
float x;
float y;
float z;
} Vector3;
typedef struct Vector4
{
float x;
float y;
float z;
float w;
} Vector4;
typedef Vector4 Quaternion;
typedef struct Matrix
{
float m0, m4, m8, m12;
float m1, m5, m9, m13;
float m2, m6, m10, m14;
float m3, m7, m11, m15;
} Matrix;
typedef struct Color
{
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
} Color;
typedef struct Rectangle
{
float x;
float y;
float width;
float height;
} Rectangle;
typedef struct Image
{
void *data; int width; int height; int mipmaps; int format; } Image;
typedef struct Texture2D
{
unsigned int id; int width; int height; int mipmaps; int format; } Texture2D;
typedef Texture2D Texture;
typedef Texture2D TextureCubemap;
typedef struct RenderTexture2D
{
unsigned int id; Texture2D texture; Texture2D depth; bool depthTexture; } RenderTexture2D;
typedef RenderTexture2D RenderTexture;
typedef struct NPatchInfo
{
Rectangle sourceRec; int left; int top; int right; int bottom; int type; } NPatchInfo;
typedef struct CharInfo
{
int value; Rectangle rec; int offsetX; int offsetY; int advanceX; unsigned char *data; } CharInfo;
typedef struct Font
{
Texture2D texture; int baseSize; int charsCount; CharInfo *chars; } Font;
#define SpriteFont Font
typedef struct Camera3D
{
Vector3 position; Vector3 target; Vector3 up; float fovy; int type; } Camera3D;
typedef Camera3D Camera;
typedef struct Camera2D
{
Vector2 offset; Vector2 target; float rotation; float zoom; } Camera2D;
typedef struct Mesh
{
int vertexCount; int triangleCount;
float *vertices; float *texcoords; float *texcoords2; float *normals; float *tangents; unsigned char *colors; unsigned short *indices;
float *animVertices; float *animNormals; int *boneIds; float *boneWeights;
unsigned int vaoId; unsigned int vboId[7]; } Mesh;
typedef struct Shader
{
unsigned int id; int locs[MAX_SHADER_LOCATIONS]; } Shader;
typedef struct MaterialMap
{
Texture2D texture; Color color; float value; } MaterialMap;
typedef struct Material
{
Shader shader; MaterialMap maps[MAX_MATERIAL_MAPS]; float *params; } Material;
typedef struct Transform
{
Vector3 translation; Quaternion rotation; Vector3 scale; } Transform;
typedef struct BoneInfo
{
char name[32]; int parent; } BoneInfo;
typedef struct Model
{
Matrix transform;
int meshCount; Mesh *meshes;
int materialCount; Material *materials; int *meshMaterial;
int boneCount; BoneInfo *bones; Transform *bindPose; } Model;
typedef struct ModelAnimation
{
int boneCount; BoneInfo *bones;
int frameCount; Transform **framePoses; } ModelAnimation;
typedef struct Ray
{
Vector3 position; Vector3 direction; } Ray;
typedef struct RayHitInfo
{
bool hit; float distance; Vector3 position; Vector3 normal; } RayHitInfo;
typedef struct BoundingBox
{
Vector3 min; Vector3 max; } BoundingBox;
typedef struct Wave
{
unsigned int sampleCount; unsigned int sampleRate; unsigned int sampleSize; unsigned int channels; void *data; } Wave;
typedef struct Sound
{
void *audioBuffer;
unsigned int source; unsigned int buffer; int format; } Sound;
typedef struct MusicData *Music;
typedef struct AudioStream
{
unsigned int sampleRate; unsigned int sampleSize; unsigned int channels;
void *audioBuffer;
int format; unsigned int source; unsigned int buffers[2]; } AudioStream;
typedef struct VrDeviceInfo
{
int hResolution; int vResolution; float hScreenSize; float vScreenSize; float vScreenCenter; float eyeToScreenDistance; float lensSeparationDistance; float interpupillaryDistance; float lensDistortionValues[4]; float chromaAbCorrection[4]; } VrDeviceInfo;
typedef enum
{
FLAG_SHOW_LOGO = 1, FLAG_FULLSCREEN_MODE = 2, FLAG_WINDOW_RESIZABLE = 4, FLAG_WINDOW_UNDECORATED = 8, FLAG_WINDOW_TRANSPARENT = 16, FLAG_WINDOW_HIDDEN = 128, FLAG_MSAA_4X_HINT = 32, FLAG_VSYNC_HINT = 64 } ConfigFlag;
typedef enum
{
LOG_ALL = 0, LOG_TRACE,
LOG_DEBUG,
LOG_INFO,
LOG_WARNING,
LOG_ERROR,
LOG_FATAL,
LOG_NONE } TraceLogType;
typedef enum
{
KEY_APOSTROPHE = 39,
KEY_COMMA = 44,
KEY_MINUS = 45,
KEY_PERIOD = 46,
KEY_SLASH = 47,
KEY_ZERO = 48,
KEY_ONE = 49,
KEY_TWO = 50,
KEY_THREE = 51,
KEY_FOUR = 52,
KEY_FIVE = 53,
KEY_SIX = 54,
KEY_SEVEN = 55,
KEY_EIGHT = 56,
KEY_NINE = 57,
KEY_SEMICOLON = 59,
KEY_EQUAL = 61,
KEY_A = 65,
KEY_B = 66,
KEY_C = 67,
KEY_D = 68,
KEY_E = 69,
KEY_F = 70,
KEY_G = 71,
KEY_H = 72,
KEY_I = 73,
KEY_J = 74,
KEY_K = 75,
KEY_L = 76,
KEY_M = 77,
KEY_N = 78,
KEY_O = 79,
KEY_P = 80,
KEY_Q = 81,
KEY_R = 82,
KEY_S = 83,
KEY_T = 84,
KEY_U = 85,
KEY_V = 86,
KEY_W = 87,
KEY_X = 88,
KEY_Y = 89,
KEY_Z = 90,
KEY_SPACE = 32,
KEY_ESCAPE = 256,
KEY_ENTER = 257,
KEY_TAB = 258,
KEY_BACKSPACE = 259,
KEY_INSERT = 260,
KEY_DELETE = 261,
KEY_RIGHT = 262,
KEY_LEFT = 263,
KEY_DOWN = 264,
KEY_UP = 265,
KEY_PAGE_UP = 266,
KEY_PAGE_DOWN = 267,
KEY_HOME = 268,
KEY_END = 269,
KEY_CAPS_LOCK = 280,
KEY_SCROLL_LOCK = 281,
KEY_NUM_LOCK = 282,
KEY_PRINT_SCREEN = 283,
KEY_PAUSE = 284,
KEY_F1 = 290,
KEY_F2 = 291,
KEY_F3 = 292,
KEY_F4 = 293,
KEY_F5 = 294,
KEY_F6 = 295,
KEY_F7 = 296,
KEY_F8 = 297,
KEY_F9 = 298,
KEY_F10 = 299,
KEY_F11 = 300,
KEY_F12 = 301,
KEY_LEFT_SHIFT = 340,
KEY_LEFT_CONTROL = 341,
KEY_LEFT_ALT = 342,
KEY_LEFT_SUPER = 343,
KEY_RIGHT_SHIFT = 344,
KEY_RIGHT_CONTROL = 345,
KEY_RIGHT_ALT = 346,
KEY_RIGHT_SUPER = 347,
KEY_KB_MENU = 348,
KEY_LEFT_BRACKET = 91,
KEY_BACKSLASH = 92,
KEY_RIGHT_BRACKET = 93,
KEY_GRAVE = 96,
KEY_KP_0 = 320,
KEY_KP_1 = 321,
KEY_KP_2 = 322,
KEY_KP_3 = 323,
KEY_KP_4 = 324,
KEY_KP_5 = 325,
KEY_KP_6 = 326,
KEY_KP_7 = 327,
KEY_KP_8 = 328,
KEY_KP_9 = 329,
KEY_KP_DECIMAL = 330,
KEY_KP_DIVIDE = 331,
KEY_KP_MULTIPLY = 332,
KEY_KP_SUBTRACT = 333,
KEY_KP_ADD = 334,
KEY_KP_ENTER = 335,
KEY_KP_EQUAL = 336
} KeyboardKey;
typedef enum
{
KEY_BACK = 4,
KEY_MENU = 82,
KEY_VOLUME_UP = 24,
KEY_VOLUME_DOWN = 25
} AndroidButton;
typedef enum
{
MOUSE_LEFT_BUTTON = 0,
MOUSE_RIGHT_BUTTON = 1,
MOUSE_MIDDLE_BUTTON = 2
} MouseButton;
typedef enum
{
GAMEPAD_PLAYER1 = 0,
GAMEPAD_PLAYER2 = 1,
GAMEPAD_PLAYER3 = 2,
GAMEPAD_PLAYER4 = 3
} GamepadNumber;
typedef enum
{
GAMEPAD_BUTTON_UNKNOWN = 0,
GAMEPAD_BUTTON_LEFT_FACE_UP,
GAMEPAD_BUTTON_LEFT_FACE_RIGHT,
GAMEPAD_BUTTON_LEFT_FACE_DOWN,
GAMEPAD_BUTTON_LEFT_FACE_LEFT,
GAMEPAD_BUTTON_RIGHT_FACE_UP,
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT,
GAMEPAD_BUTTON_RIGHT_FACE_DOWN,
GAMEPAD_BUTTON_RIGHT_FACE_LEFT,
GAMEPAD_BUTTON_LEFT_TRIGGER_1,
GAMEPAD_BUTTON_LEFT_TRIGGER_2,
GAMEPAD_BUTTON_RIGHT_TRIGGER_1,
GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
GAMEPAD_BUTTON_MIDDLE_LEFT, GAMEPAD_BUTTON_MIDDLE, GAMEPAD_BUTTON_MIDDLE_RIGHT,
GAMEPAD_BUTTON_LEFT_THUMB,
GAMEPAD_BUTTON_RIGHT_THUMB
} GamepadButton;
typedef enum
{
GAMEPAD_AXIS_UNKNOWN = 0,
GAMEPAD_AXIS_LEFT_X,
GAMEPAD_AXIS_LEFT_Y,
GAMEPAD_AXIS_RIGHT_X,
GAMEPAD_AXIS_RIGHT_Y,
GAMEPAD_AXIS_LEFT_TRIGGER, GAMEPAD_AXIS_RIGHT_TRIGGER } GamepadAxis;
typedef enum
{
LOC_VERTEX_POSITION = 0,
LOC_VERTEX_TEXCOORD01,
LOC_VERTEX_TEXCOORD02,
LOC_VERTEX_NORMAL,
LOC_VERTEX_TANGENT,
LOC_VERTEX_COLOR,
LOC_MATRIX_MVP,
LOC_MATRIX_MODEL,
LOC_MATRIX_VIEW,
LOC_MATRIX_PROJECTION,
LOC_VECTOR_VIEW,
LOC_COLOR_DIFFUSE,
LOC_COLOR_SPECULAR,
LOC_COLOR_AMBIENT,
LOC_MAP_ALBEDO, LOC_MAP_METALNESS, LOC_MAP_NORMAL,
LOC_MAP_ROUGHNESS,
LOC_MAP_OCCLUSION,
LOC_MAP_EMISSION,
LOC_MAP_HEIGHT,
LOC_MAP_CUBEMAP,
LOC_MAP_IRRADIANCE,
LOC_MAP_PREFILTER,
LOC_MAP_BRDF
} ShaderLocationIndex;
#define LOC_MAP_DIFFUSE LOC_MAP_ALBEDO
#define LOC_MAP_SPECULAR LOC_MAP_METALNESS
typedef enum
{
UNIFORM_FLOAT = 0,
UNIFORM_VEC2,
UNIFORM_VEC3,
UNIFORM_VEC4,
UNIFORM_INT,
UNIFORM_IVEC2,
UNIFORM_IVEC3,
UNIFORM_IVEC4,
UNIFORM_SAMPLER2D
} ShaderUniformDataType;
typedef enum
{
MAP_ALBEDO = 0, MAP_METALNESS = 1, MAP_NORMAL = 2,
MAP_ROUGHNESS = 3,
MAP_OCCLUSION,
MAP_EMISSION,
MAP_HEIGHT,
MAP_CUBEMAP, MAP_IRRADIANCE, MAP_PREFILTER, MAP_BRDF
} MaterialMapType;
#define MAP_DIFFUSE MAP_ALBEDO
#define MAP_SPECULAR MAP_METALNESS
typedef enum
{
UNCOMPRESSED_GRAYSCALE = 1, UNCOMPRESSED_GRAY_ALPHA, UNCOMPRESSED_R5G6B5, UNCOMPRESSED_R8G8B8, UNCOMPRESSED_R5G5B5A1, UNCOMPRESSED_R4G4B4A4, UNCOMPRESSED_R8G8B8A8, UNCOMPRESSED_R32, UNCOMPRESSED_R32G32B32, UNCOMPRESSED_R32G32B32A32, COMPRESSED_DXT1_RGB, COMPRESSED_DXT1_RGBA, COMPRESSED_DXT3_RGBA, COMPRESSED_DXT5_RGBA, COMPRESSED_ETC1_RGB, COMPRESSED_ETC2_RGB, COMPRESSED_ETC2_EAC_RGBA, COMPRESSED_PVRT_RGB, COMPRESSED_PVRT_RGBA, COMPRESSED_ASTC_4x4_RGBA, COMPRESSED_ASTC_8x8_RGBA } PixelFormat;
typedef enum
{
FILTER_POINT = 0, FILTER_BILINEAR, FILTER_TRILINEAR, FILTER_ANISOTROPIC_4X, FILTER_ANISOTROPIC_8X, FILTER_ANISOTROPIC_16X, } TextureFilterMode;
typedef enum
{
CUBEMAP_AUTO_DETECT = 0, CUBEMAP_LINE_VERTICAL, CUBEMAP_LINE_HORIZONTAL, CUBEMAP_CROSS_THREE_BY_FOUR, CUBEMAP_CROSS_FOUR_BY_THREE, CUBEMAP_PANORAMA } CubemapLayoutType;
typedef enum
{
WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR_REPEAT, WRAP_MIRROR_CLAMP } TextureWrapMode;
typedef enum
{
FONT_DEFAULT = 0, FONT_BITMAP, FONT_SDF } FontType;
typedef enum
{
BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode;
typedef enum
{
GESTURE_NONE = 0,
GESTURE_TAP = 1,
GESTURE_DOUBLETAP = 2,
GESTURE_HOLD = 4,
GESTURE_DRAG = 8,
GESTURE_SWIPE_RIGHT = 16,
GESTURE_SWIPE_LEFT = 32,
GESTURE_SWIPE_UP = 64,
GESTURE_SWIPE_DOWN = 128,
GESTURE_PINCH_IN = 256,
GESTURE_PINCH_OUT = 512
} GestureType;
typedef enum
{
CAMERA_CUSTOM = 0,
CAMERA_FREE,
CAMERA_ORBITAL,
CAMERA_FIRST_PERSON,
CAMERA_THIRD_PERSON
} CameraMode;
typedef enum
{
CAMERA_PERSPECTIVE = 0,
CAMERA_ORTHOGRAPHIC
} CameraType;
typedef enum
{
NPT_9PATCH = 0, NPT_3PATCH_VERTICAL, NPT_3PATCH_HORIZONTAL } NPatchType;
typedef void (*TraceLogCallback)(int logType, const char *text, va_list args);
#if defined(__cplusplus)
extern "C"
{ #endif
RLAPI void InitWindow(int width, int height, const char *title); RLAPI bool WindowShouldClose(void); RLAPI void CloseWindow(void); RLAPI bool IsWindowReady(void); RLAPI bool IsWindowMinimized(void); RLAPI bool IsWindowResized(void); RLAPI bool IsWindowHidden(void); RLAPI void ToggleFullscreen(void); RLAPI void UnhideWindow(void); RLAPI void HideWindow(void); RLAPI void SetWindowIcon(Image image); RLAPI void SetWindowTitle(const char *title); RLAPI void SetWindowPosition(int x, int y); RLAPI void SetWindowMonitor(int monitor); RLAPI void SetWindowMinSize(int width, int height); RLAPI void SetWindowSize(int width, int height); RLAPI void *GetWindowHandle(void); RLAPI int GetScreenWidth(void); RLAPI int GetScreenHeight(void); RLAPI int GetMonitorCount(void); RLAPI int GetMonitorWidth(int monitor); RLAPI int GetMonitorHeight(int monitor); RLAPI int GetMonitorPhysicalWidth(int monitor); RLAPI int GetMonitorPhysicalHeight(int monitor); RLAPI const char *GetMonitorName(int monitor); RLAPI const char *GetClipboardText(void); RLAPI void SetClipboardText(const char *text);
RLAPI void ShowCursor(void); RLAPI void HideCursor(void); RLAPI bool IsCursorHidden(void); RLAPI void EnableCursor(void); RLAPI void DisableCursor(void);
RLAPI void ClearBackground(Color color); RLAPI void BeginDrawing(void); RLAPI void EndDrawing(void); RLAPI void BeginMode2D(Camera2D camera); RLAPI void EndMode2D(void); RLAPI void BeginMode3D(Camera3D camera); RLAPI void EndMode3D(void); RLAPI void BeginTextureMode(RenderTexture2D target); RLAPI void EndTextureMode(void);
RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); RLAPI Matrix GetCameraMatrix(Camera camera);
RLAPI void SetTargetFPS(int fps); RLAPI int GetFPS(void); RLAPI float GetFrameTime(void); RLAPI double GetTime(void);
RLAPI int ColorToInt(Color color); RLAPI Vector4 ColorNormalize(Color color); RLAPI Vector3 ColorToHSV(Color color); RLAPI Color ColorFromHSV(Vector3 hsv); RLAPI Color GetColor(int hexValue); RLAPI Color Fade(Color color, float alpha);
RLAPI void SetConfigFlags(unsigned char flags); RLAPI void SetTraceLogLevel(int logType); RLAPI void SetTraceLogExit(int logType); RLAPI void SetTraceLogCallback(TraceLogCallback callback); RLAPI void TraceLog(int logType, const char *text, ...); RLAPI void TakeScreenshot(const char *fileName); RLAPI int GetRandomValue(int min, int max);
RLAPI bool FileExists(const char *fileName); RLAPI bool IsFileExtension(const char *fileName, const char *ext); RLAPI const char *GetExtension(const char *fileName); RLAPI const char *GetFileName(const char *filePath); RLAPI const char *GetFileNameWithoutExt(const char *filePath); RLAPI const char *GetDirectoryPath(const char *fileName); RLAPI const char *GetWorkingDirectory(void); RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); RLAPI void ClearDirectoryFiles(void); RLAPI bool ChangeDirectory(const char *dir); RLAPI bool IsFileDropped(void); RLAPI char **GetDroppedFiles(int *count); RLAPI void ClearDroppedFiles(void); RLAPI long GetFileModTime(const char *fileName);
RLAPI void StorageSaveValue(int position, int value); RLAPI int StorageLoadValue(int position);
RLAPI void OpenURL(const char *url);
RLAPI bool IsKeyPressed(int key); RLAPI bool IsKeyDown(int key); RLAPI bool IsKeyReleased(int key); RLAPI bool IsKeyUp(int key); RLAPI int GetKeyPressed(void); RLAPI void SetExitKey(int key);
RLAPI bool IsGamepadAvailable(int gamepad); RLAPI bool IsGamepadName(int gamepad, const char *name); RLAPI const char *GetGamepadName(int gamepad); RLAPI bool IsGamepadButtonPressed(int gamepad, int button); RLAPI bool IsGamepadButtonDown(int gamepad, int button); RLAPI bool IsGamepadButtonReleased(int gamepad, int button); RLAPI bool IsGamepadButtonUp(int gamepad, int button); RLAPI int GetGamepadButtonPressed(void); RLAPI int GetGamepadAxisCount(int gamepad); RLAPI float GetGamepadAxisMovement(int gamepad, int axis);
RLAPI bool IsMouseButtonPressed(int button); RLAPI bool IsMouseButtonDown(int button); RLAPI bool IsMouseButtonReleased(int button); RLAPI bool IsMouseButtonUp(int button); RLAPI int GetMouseX(void); RLAPI int GetMouseY(void); RLAPI Vector2 GetMousePosition(void); RLAPI void SetMousePosition(int x, int y); RLAPI void SetMouseOffset(int offsetX, int offsetY); RLAPI void SetMouseScale(float scaleX, float scaleY); RLAPI int GetMouseWheelMove(void);
RLAPI int GetTouchX(void); RLAPI int GetTouchY(void); RLAPI Vector2 GetTouchPosition(int index);
RLAPI void SetGesturesEnabled(unsigned int gestureFlags); RLAPI bool IsGestureDetected(int gesture); RLAPI int GetGestureDetected(void); RLAPI int GetTouchPointsCount(void); RLAPI float GetGestureHoldDuration(void); RLAPI Vector2 GetGestureDragVector(void); RLAPI float GetGestureDragAngle(void); RLAPI Vector2 GetGesturePinchVector(void); RLAPI float GetGesturePinchAngle(void);
RLAPI void SetCameraMode(Camera camera, int mode); RLAPI void UpdateCamera(Camera *camera);
RLAPI void SetCameraPanControl(int panKey); RLAPI void SetCameraAltControl(int altKey); RLAPI void SetCameraSmoothZoomControl(int szKey); RLAPI void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey);
RLAPI void DrawPixel(int posX, int posY, Color color); RLAPI void DrawPixelV(Vector2 position, Color color); RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); RLAPI void DrawLineStrip(Vector2 *points, int numPoints, Color color); RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); RLAPI void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); RLAPI void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); RLAPI void DrawCircleV(Vector2 center, float radius, Color color); RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); RLAPI void DrawRectangleRec(Rectangle rec, Color color); RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2); RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color); RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); RLAPI void DrawTriangleFan(Vector2 *points, int numPoints, Color color); RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color);
RLAPI void SetShapesTexture(Texture2D texture, Rectangle source);
RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);
RLAPI Image LoadImage(const char *fileName); RLAPI Image LoadImageEx(Color *pixels, int width, int height); RLAPI Image LoadImagePro(void *data, int width, int height, int format); RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); RLAPI void ExportImage(Image image, const char *fileName); RLAPI void ExportImageAsCode(Image image, const char *fileName); RLAPI Texture2D LoadTexture(const char *fileName); RLAPI Texture2D LoadTextureFromImage(Image image); RLAPI TextureCubemap LoadTextureCubemap(Image image, int layoutType); RLAPI RenderTexture2D LoadRenderTexture(int width, int height); RLAPI void UnloadImage(Image image); RLAPI void UnloadTexture(Texture2D texture); RLAPI void UnloadRenderTexture(RenderTexture2D target); RLAPI Color *GetImageData(Image image); RLAPI Vector4 *GetImageDataNormalized(Image image); RLAPI int GetPixelDataSize(int width, int height, int format); RLAPI Image GetTextureData(Texture2D texture); RLAPI Image GetScreenData(void); RLAPI void UpdateTexture(Texture2D texture, const void *pixels);
RLAPI Image ImageCopy(Image image); RLAPI void ImageToPOT(Image *image, Color fillColor); RLAPI void ImageFormat(Image *image, int newFormat); RLAPI void ImageAlphaMask(Image *image, Image alphaMask); RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); RLAPI void ImageAlphaCrop(Image *image, float threshold); RLAPI void ImageAlphaPremultiply(Image *image); RLAPI void ImageCrop(Image *image, Rectangle crop); RLAPI void ImageResize(Image *image, int newWidth, int newHeight); RLAPI void ImageResizeNN(Image *image, int newWidth, int newHeight); RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); RLAPI void ImageMipmaps(Image *image); RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); RLAPI Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount); RLAPI Image ImageText(const char *text, int fontSize, Color color); RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); RLAPI void ImageDrawRectangle(Image *dst, Rectangle rec, Color color); RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); RLAPI void ImageFlipVertical(Image *image); RLAPI void ImageFlipHorizontal(Image *image); RLAPI void ImageRotateCW(Image *image); RLAPI void ImageRotateCCW(Image *image); RLAPI void ImageColorTint(Image *image, Color color); RLAPI void ImageColorInvert(Image *image); RLAPI void ImageColorGrayscale(Image *image); RLAPI void ImageColorContrast(Image *image, float contrast); RLAPI void ImageColorBrightness(Image *image, int brightness); RLAPI void ImageColorReplace(Image *image, Color color, Color replace);
RLAPI Image GenImageColor(int width, int height, Color color); RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); RLAPI Image GenImageWhiteNoise(int width, int height, float factor); RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); RLAPI Image GenImageCellular(int width, int height, int tileSize);
RLAPI void GenTextureMipmaps(Texture2D *texture); RLAPI void SetTextureFilter(Texture2D texture, int filterMode); RLAPI void SetTextureWrap(Texture2D texture, int wrapMode);
RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint);
RLAPI Font GetFontDefault(void); RLAPI Font LoadFont(const char *fileName); RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, int type); RLAPI Image GenImageFontAtlas(CharInfo *chars, int charsCount, int fontSize, int padding, int packMethod); RLAPI void UnloadFont(Font font);
RLAPI void DrawFPS(int posX, int posY); RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint,
int selectStart, int selectLength, Color selectText, Color selectBack);
RLAPI int MeasureText(const char *text, int fontSize); RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); RLAPI int GetGlyphIndex(Font font, int character); RLAPI int GetNextCodepoint(const char *text, int *count);
RLAPI bool TextIsEqual(const char *text1, const char *text2); RLAPI unsigned int TextLength(const char *text); RLAPI unsigned int TextCountCodepoints(const char *text); RLAPI const char *TextFormat(const char *text, ...); RLAPI const char *TextSubtext(const char *text, int position, int length); RLAPI const char *TextReplace(char *text, const char *replace, const char *by); RLAPI const char *TextInsert(const char *text, const char *insert, int position); RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); RLAPI const char **TextSplit(const char *text, char delimiter, int *count); RLAPI void TextAppend(char *text, const char *append, int *position); RLAPI int TextFindIndex(const char *text, const char *find); RLAPI const char *TextToUpper(const char *text); RLAPI const char *TextToLower(const char *text); RLAPI const char *TextToPascal(const char *text); RLAPI int TextToInteger(const char *text);
RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); RLAPI void DrawRay(Ray ray, Color color); RLAPI void DrawGrid(int slices, float spacing); RLAPI void DrawGizmo(Vector3 position);
RLAPI Model LoadModel(const char *fileName); RLAPI Model LoadModelFromMesh(Mesh mesh); RLAPI void UnloadModel(Model model);
RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); RLAPI void ExportMesh(Mesh mesh, const char *fileName); RLAPI void UnloadMesh(Mesh *mesh);
RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); RLAPI Material LoadMaterialDefault(void); RLAPI void UnloadMaterial(Material material); RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId);
RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); RLAPI void UnloadModelAnimation(ModelAnimation anim); RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim);
RLAPI Mesh GenMeshPoly(int sides, float radius); RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); RLAPI Mesh GenMeshCube(float width, float height, float length); RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize);
RLAPI BoundingBox MeshBoundingBox(Mesh mesh); RLAPI void MeshTangents(Mesh *mesh); RLAPI void MeshBinormals(Mesh *mesh);
RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); RLAPI void DrawBoundingBox(BoundingBox box, Color color); RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint);
RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model *model); RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight);
RLAPI char *LoadText(const char *fileName); RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); RLAPI Shader LoadShaderCode(char *vsCode, char *fsCode); RLAPI void UnloadShader(Shader shader);
RLAPI Shader GetShaderDefault(void); RLAPI Texture2D GetTextureDefault(void);
RLAPI int GetShaderLocation(Shader shader, const char *uniformName); RLAPI void SetShaderValue(Shader shader, int uniformLoc, const void *value, int uniformType); RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); RLAPI void SetMatrixProjection(Matrix proj); RLAPI void SetMatrixModelview(Matrix view); RLAPI Matrix GetMatrixModelview();
RLAPI Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size); RLAPI Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size); RLAPI Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size); RLAPI Texture2D GenTextureBRDF(Shader shader, int size);
RLAPI void BeginShaderMode(Shader shader); RLAPI void EndShaderMode(void); RLAPI void BeginBlendMode(int mode); RLAPI void EndBlendMode(void); RLAPI void BeginScissorMode(int x, int y, int width, int height); RLAPI void EndScissorMode(void);
RLAPI void InitVrSimulator(void); RLAPI void CloseVrSimulator(void); RLAPI void UpdateVrTracking(Camera *camera); RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); RLAPI bool IsVrSimulatorReady(void); RLAPI void ToggleVrMode(void); RLAPI void BeginVrDrawing(void); RLAPI void EndVrDrawing(void);
RLAPI void InitAudioDevice(void); RLAPI void CloseAudioDevice(void); RLAPI bool IsAudioDeviceReady(void); RLAPI void SetMasterVolume(float volume);
RLAPI Wave LoadWave(const char *fileName); RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); RLAPI Sound LoadSound(const char *fileName); RLAPI Sound LoadSoundFromWave(Wave wave); RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount); RLAPI void UnloadWave(Wave wave); RLAPI void UnloadSound(Sound sound); RLAPI void ExportWave(Wave wave, const char *fileName); RLAPI void ExportWaveAsCode(Wave wave, const char *fileName);
RLAPI void PlaySound(Sound sound); RLAPI void PauseSound(Sound sound); RLAPI void ResumeSound(Sound sound); RLAPI void StopSound(Sound sound); RLAPI bool IsSoundPlaying(Sound sound); RLAPI void SetSoundVolume(Sound sound, float volume); RLAPI void SetSoundPitch(Sound sound, float pitch); RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); RLAPI Wave WaveCopy(Wave wave); RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); RLAPI float *GetWaveData(Wave wave);
RLAPI Music LoadMusicStream(const char *fileName); RLAPI void UnloadMusicStream(Music music); RLAPI void PlayMusicStream(Music music); RLAPI void UpdateMusicStream(Music music); RLAPI void StopMusicStream(Music music); RLAPI void PauseMusicStream(Music music); RLAPI void ResumeMusicStream(Music music); RLAPI bool IsMusicPlaying(Music music); RLAPI void SetMusicVolume(Music music, float volume); RLAPI void SetMusicPitch(Music music, float pitch); RLAPI void SetMusicLoopCount(Music music, int count); RLAPI float GetMusicTimeLength(Music music); RLAPI float GetMusicTimePlayed(Music music);
RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); RLAPI void CloseAudioStream(AudioStream stream); RLAPI bool IsAudioBufferProcessed(AudioStream stream); RLAPI void PlayAudioStream(AudioStream stream); RLAPI void PauseAudioStream(AudioStream stream); RLAPI void ResumeAudioStream(AudioStream stream); RLAPI bool IsAudioStreamPlaying(AudioStream stream); RLAPI void StopAudioStream(AudioStream stream); RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch);
#if defined(__cplusplus)
}
#endif
#endif