raylib 5.5.0.3rc1__cp311-cp311-macosx_15_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of raylib might be problematic. Click here for more details.
- pyray/__init__.py +159 -0
- pyray/__init__.pyi +4555 -0
- pyray/py.typed +0 -0
- raylib/__init__.py +34 -0
- raylib/__init__.pyi +4423 -0
- raylib/_raylib_cffi.cpython-311-darwin.so +0 -0
- raylib/build.py +322 -0
- raylib/colors.py +41 -0
- raylib/defines.py +508 -0
- raylib/enums.py +759 -0
- raylib/glfw3.h.modified +5618 -0
- raylib/physac.h.modified +171 -0
- raylib/py.typed +0 -0
- raylib/raygui.h.modified +865 -0
- raylib/raylib.h.modified +1448 -0
- raylib/raymath.h.modified +249 -0
- raylib/rlgl.h.modified +522 -0
- raylib/version.py +1 -0
- raylib-5.5.0.3rc1.dist-info/METADATA +313 -0
- raylib-5.5.0.3rc1.dist-info/RECORD +23 -0
- raylib-5.5.0.3rc1.dist-info/WHEEL +5 -0
- raylib-5.5.0.3rc1.dist-info/licenses/LICENSE +277 -0
- raylib-5.5.0.3rc1.dist-info/top_level.txt +2 -0
raylib/raylib.h.modified
ADDED
|
@@ -0,0 +1,1448 @@
|
|
|
1
|
+
/**********************************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* raylib v5.5 - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
|
|
4
|
+
*
|
|
5
|
+
* FEATURES:
|
|
6
|
+
* - NO external dependencies, all required libraries included with raylib
|
|
7
|
+
* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly,
|
|
8
|
+
* MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5.
|
|
9
|
+
* - Written in plain C code (C99) in PascalCase/camelCase notation
|
|
10
|
+
* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3, ES2, ES3 - choose at compile)
|
|
11
|
+
* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
|
|
12
|
+
* - Multiple Fonts formats supported (TTF, OTF, FNT, BDF, Sprite fonts)
|
|
13
|
+
* - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC)
|
|
14
|
+
* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more!
|
|
15
|
+
* - Flexible Materials system, supporting classic maps and PBR maps
|
|
16
|
+
* - Animated 3D models supported (skeletal bones animation) (IQM, M3D, GLTF)
|
|
17
|
+
* - Shaders support, including Model shaders and Postprocessing shaders
|
|
18
|
+
* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
|
|
19
|
+
* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, QOA, XM, MOD)
|
|
20
|
+
* - VR stereo rendering with configurable HMD device parameters
|
|
21
|
+
* - Bindings to multiple programming languages available!
|
|
22
|
+
*
|
|
23
|
+
* NOTES:
|
|
24
|
+
* - One default Font is loaded on InitWindow()->LoadFontDefault() [core, text]
|
|
25
|
+
* - One default Texture2D is loaded on rlglInit(), 1x1 white pixel R8G8B8A8 [rlgl] (OpenGL 3.3 or ES2)
|
|
26
|
+
* - One default Shader is loaded on rlglInit()->rlLoadShaderDefault() [rlgl] (OpenGL 3.3 or ES2)
|
|
27
|
+
* - One default RenderBatch is loaded on rlglInit()->rlLoadRenderBatch() [rlgl] (OpenGL 3.3 or ES2)
|
|
28
|
+
*
|
|
29
|
+
* DEPENDENCIES (included):
|
|
30
|
+
* [rcore][GLFW] rglfw (Camilla Löwy - github.com/glfw/glfw) for window/context management and input
|
|
31
|
+
* [rcore][RGFW] rgfw (ColleagueRiley - github.com/ColleagueRiley/RGFW) for window/context management and input
|
|
32
|
+
* [rlgl] glad/glad_gles2 (David Herberth - github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading
|
|
33
|
+
* [raudio] miniaudio (David Reid - github.com/mackron/miniaudio) for audio device/context management
|
|
34
|
+
*
|
|
35
|
+
* OPTIONAL DEPENDENCIES (included):
|
|
36
|
+
* [rcore] msf_gif (Miles Fogle) for GIF recording
|
|
37
|
+
* [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorithm
|
|
38
|
+
* [rcore] sdefl (Micha Mettke) for DEFLATE compression algorithm
|
|
39
|
+
* [rcore] rprand (Ramon Snatamaria) for pseudo-random numbers generation
|
|
40
|
+
* [rtextures] qoi (Dominic Szablewski - https://phoboslab.org) for QOI image manage
|
|
41
|
+
* [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...)
|
|
42
|
+
* [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG)
|
|
43
|
+
* [rtextures] stb_image_resize2 (Sean Barret) for image resizing algorithms
|
|
44
|
+
* [rtextures] stb_perlin (Sean Barret) for Perlin Noise image generation
|
|
45
|
+
* [rtext] stb_truetype (Sean Barret) for ttf fonts loading
|
|
46
|
+
* [rtext] stb_rect_pack (Sean Barret) for rectangles packing
|
|
47
|
+
* [rmodels] par_shapes (Philip Rideout) for parametric 3d shapes generation
|
|
48
|
+
* [rmodels] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL)
|
|
49
|
+
* [rmodels] cgltf (Johannes Kuhlmann) for models loading (glTF)
|
|
50
|
+
* [rmodels] m3d (bzt) for models loading (M3D, https://bztsrc.gitlab.io/model3d)
|
|
51
|
+
* [rmodels] vox_loader (Johann Nadalutti) for models loading (VOX)
|
|
52
|
+
* [raudio] dr_wav (David Reid) for WAV audio file loading
|
|
53
|
+
* [raudio] dr_flac (David Reid) for FLAC audio file loading
|
|
54
|
+
* [raudio] dr_mp3 (David Reid) for MP3 audio file loading
|
|
55
|
+
* [raudio] stb_vorbis (Sean Barret) for OGG audio loading
|
|
56
|
+
* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading
|
|
57
|
+
* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading
|
|
58
|
+
* [raudio] qoa (Dominic Szablewski - https://phoboslab.org) for QOA audio manage
|
|
59
|
+
*
|
|
60
|
+
*
|
|
61
|
+
* LICENSE: zlib/libpng
|
|
62
|
+
*
|
|
63
|
+
* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
|
64
|
+
* BSD-like license that allows static linking with closed source software:
|
|
65
|
+
*
|
|
66
|
+
* Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
|
|
67
|
+
*
|
|
68
|
+
* This software is provided "as-is", without any express or implied warranty. In no event
|
|
69
|
+
* will the authors be held liable for any damages arising from the use of this software.
|
|
70
|
+
*
|
|
71
|
+
* Permission is granted to anyone to use this software for any purpose, including commercial
|
|
72
|
+
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
|
73
|
+
*
|
|
74
|
+
* 1. The origin of this software must not be misrepresented; you must not claim that you
|
|
75
|
+
* wrote the original software. If you use this software in a product, an acknowledgment
|
|
76
|
+
* in the product documentation would be appreciated but is not required.
|
|
77
|
+
*
|
|
78
|
+
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
|
79
|
+
* as being the original software.
|
|
80
|
+
*
|
|
81
|
+
* 3. This notice may not be removed or altered from any source distribution.
|
|
82
|
+
*
|
|
83
|
+
**********************************************************************************************/
|
|
84
|
+
// Function specifiers in case library is build/used as a shared library
|
|
85
|
+
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
|
|
86
|
+
// NOTE: visibility("default") attribute makes symbols "visible" when compiled with -fvisibility=hidden
|
|
87
|
+
//----------------------------------------------------------------------------------
|
|
88
|
+
// Some basic Defines
|
|
89
|
+
//----------------------------------------------------------------------------------
|
|
90
|
+
// Allow custom memory allocators
|
|
91
|
+
// NOTE: Require recompiling raylib sources
|
|
92
|
+
// NOTE: MSVC C++ compiler does not support compound literals (C99 feature)
|
|
93
|
+
// Plain structures in C++ (without constructors) can be initialized with { }
|
|
94
|
+
// This is called aggregate initialization (C++11 feature)
|
|
95
|
+
// Some compilers (mostly macos clang) default to C++98,
|
|
96
|
+
// where aggregate initialization can't be used
|
|
97
|
+
// So, give a more clear error stating how to fix this
|
|
98
|
+
// NOTE: We set some defines with some data types declared by raylib
|
|
99
|
+
// Other modules (raymath, rlgl) also require some of those types, so,
|
|
100
|
+
// to be able to use those other modules as standalone (not depending on raylib)
|
|
101
|
+
// this defines are very useful for internal check and avoid type (re)definitions
|
|
102
|
+
// Some Basic Colors
|
|
103
|
+
// NOTE: Custom raylib color palette for amazing visuals on WHITE background
|
|
104
|
+
//----------------------------------------------------------------------------------
|
|
105
|
+
// Structures Definition
|
|
106
|
+
//----------------------------------------------------------------------------------
|
|
107
|
+
// Boolean type
|
|
108
|
+
// Vector2, 2 components
|
|
109
|
+
typedef struct Vector2 {
|
|
110
|
+
float x; // Vector x component
|
|
111
|
+
float y; // Vector y component
|
|
112
|
+
} Vector2;
|
|
113
|
+
// Vector3, 3 components
|
|
114
|
+
typedef struct Vector3 {
|
|
115
|
+
float x; // Vector x component
|
|
116
|
+
float y; // Vector y component
|
|
117
|
+
float z; // Vector z component
|
|
118
|
+
} Vector3;
|
|
119
|
+
// Vector4, 4 components
|
|
120
|
+
typedef struct Vector4 {
|
|
121
|
+
float x; // Vector x component
|
|
122
|
+
float y; // Vector y component
|
|
123
|
+
float z; // Vector z component
|
|
124
|
+
float w; // Vector w component
|
|
125
|
+
} Vector4;
|
|
126
|
+
// Quaternion, 4 components (Vector4 alias)
|
|
127
|
+
typedef Vector4 Quaternion;
|
|
128
|
+
// Matrix, 4x4 components, column major, OpenGL style, right-handed
|
|
129
|
+
typedef struct Matrix {
|
|
130
|
+
float m0, m4, m8, m12; // Matrix first row (4 components)
|
|
131
|
+
float m1, m5, m9, m13; // Matrix second row (4 components)
|
|
132
|
+
float m2, m6, m10, m14; // Matrix third row (4 components)
|
|
133
|
+
float m3, m7, m11, m15; // Matrix fourth row (4 components)
|
|
134
|
+
} Matrix;
|
|
135
|
+
// Color, 4 components, R8G8B8A8 (32bit)
|
|
136
|
+
typedef struct Color {
|
|
137
|
+
unsigned char r; // Color red value
|
|
138
|
+
unsigned char g; // Color green value
|
|
139
|
+
unsigned char b; // Color blue value
|
|
140
|
+
unsigned char a; // Color alpha value
|
|
141
|
+
} Color;
|
|
142
|
+
// Rectangle, 4 components
|
|
143
|
+
typedef struct Rectangle {
|
|
144
|
+
float x; // Rectangle top-left corner position x
|
|
145
|
+
float y; // Rectangle top-left corner position y
|
|
146
|
+
float width; // Rectangle width
|
|
147
|
+
float height; // Rectangle height
|
|
148
|
+
} Rectangle;
|
|
149
|
+
// Image, pixel data stored in CPU memory (RAM)
|
|
150
|
+
typedef struct Image {
|
|
151
|
+
void *data; // Image raw data
|
|
152
|
+
int width; // Image base width
|
|
153
|
+
int height; // Image base height
|
|
154
|
+
int mipmaps; // Mipmap levels, 1 by default
|
|
155
|
+
int format; // Data format (PixelFormat type)
|
|
156
|
+
} Image;
|
|
157
|
+
// Texture, tex data stored in GPU memory (VRAM)
|
|
158
|
+
typedef struct Texture {
|
|
159
|
+
unsigned int id; // OpenGL texture id
|
|
160
|
+
int width; // Texture base width
|
|
161
|
+
int height; // Texture base height
|
|
162
|
+
int mipmaps; // Mipmap levels, 1 by default
|
|
163
|
+
int format; // Data format (PixelFormat type)
|
|
164
|
+
} Texture;
|
|
165
|
+
// Texture2D, same as Texture
|
|
166
|
+
typedef Texture Texture2D;
|
|
167
|
+
// TextureCubemap, same as Texture
|
|
168
|
+
typedef Texture TextureCubemap;
|
|
169
|
+
// RenderTexture, fbo for texture rendering
|
|
170
|
+
typedef struct RenderTexture {
|
|
171
|
+
unsigned int id; // OpenGL framebuffer object id
|
|
172
|
+
Texture texture; // Color buffer attachment texture
|
|
173
|
+
Texture depth; // Depth buffer attachment texture
|
|
174
|
+
} RenderTexture;
|
|
175
|
+
// RenderTexture2D, same as RenderTexture
|
|
176
|
+
typedef RenderTexture RenderTexture2D;
|
|
177
|
+
// NPatchInfo, n-patch layout info
|
|
178
|
+
typedef struct NPatchInfo {
|
|
179
|
+
Rectangle source; // Texture source rectangle
|
|
180
|
+
int left; // Left border offset
|
|
181
|
+
int top; // Top border offset
|
|
182
|
+
int right; // Right border offset
|
|
183
|
+
int bottom; // Bottom border offset
|
|
184
|
+
int layout; // Layout of the n-patch: 3x3, 1x3 or 3x1
|
|
185
|
+
} NPatchInfo;
|
|
186
|
+
// GlyphInfo, font characters glyphs info
|
|
187
|
+
typedef struct GlyphInfo {
|
|
188
|
+
int value; // Character value (Unicode)
|
|
189
|
+
int offsetX; // Character offset X when drawing
|
|
190
|
+
int offsetY; // Character offset Y when drawing
|
|
191
|
+
int advanceX; // Character advance position X
|
|
192
|
+
Image image; // Character image data
|
|
193
|
+
} GlyphInfo;
|
|
194
|
+
// Font, font texture and GlyphInfo array data
|
|
195
|
+
typedef struct Font {
|
|
196
|
+
int baseSize; // Base size (default chars height)
|
|
197
|
+
int glyphCount; // Number of glyph characters
|
|
198
|
+
int glyphPadding; // Padding around the glyph characters
|
|
199
|
+
Texture2D texture; // Texture atlas containing the glyphs
|
|
200
|
+
Rectangle *recs; // Rectangles in texture for the glyphs
|
|
201
|
+
GlyphInfo *glyphs; // Glyphs info data
|
|
202
|
+
} Font;
|
|
203
|
+
// Camera, defines position/orientation in 3d space
|
|
204
|
+
typedef struct Camera3D {
|
|
205
|
+
Vector3 position; // Camera position
|
|
206
|
+
Vector3 target; // Camera target it looks-at
|
|
207
|
+
Vector3 up; // Camera up vector (rotation over its axis)
|
|
208
|
+
float fovy; // Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic
|
|
209
|
+
int projection; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
|
|
210
|
+
} Camera3D;
|
|
211
|
+
typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D
|
|
212
|
+
// Camera2D, defines position/orientation in 2d space
|
|
213
|
+
typedef struct Camera2D {
|
|
214
|
+
Vector2 offset; // Camera offset (displacement from target)
|
|
215
|
+
Vector2 target; // Camera target (rotation and zoom origin)
|
|
216
|
+
float rotation; // Camera rotation in degrees
|
|
217
|
+
float zoom; // Camera zoom (scaling), should be 1.0f by default
|
|
218
|
+
} Camera2D;
|
|
219
|
+
// Mesh, vertex data and vao/vbo
|
|
220
|
+
typedef struct Mesh {
|
|
221
|
+
int vertexCount; // Number of vertices stored in arrays
|
|
222
|
+
int triangleCount; // Number of triangles stored (indexed or not)
|
|
223
|
+
// Vertex attributes data
|
|
224
|
+
float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
|
225
|
+
float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
|
226
|
+
float *texcoords2; // Vertex texture second coordinates (UV - 2 components per vertex) (shader-location = 5)
|
|
227
|
+
float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
|
|
228
|
+
float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
|
|
229
|
+
unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
|
230
|
+
unsigned short *indices; // Vertex indices (in case vertex data comes indexed)
|
|
231
|
+
// Animation vertex data
|
|
232
|
+
float *animVertices; // Animated vertex positions (after bones transformations)
|
|
233
|
+
float *animNormals; // Animated normals (after bones transformations)
|
|
234
|
+
unsigned char *boneIds; // Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
|
|
235
|
+
float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
|
|
236
|
+
Matrix *boneMatrices; // Bones animated transformation matrices
|
|
237
|
+
int boneCount; // Number of bones
|
|
238
|
+
// OpenGL identifiers
|
|
239
|
+
unsigned int vaoId; // OpenGL Vertex Array Object id
|
|
240
|
+
unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data)
|
|
241
|
+
} Mesh;
|
|
242
|
+
// Shader
|
|
243
|
+
typedef struct Shader {
|
|
244
|
+
unsigned int id; // Shader program id
|
|
245
|
+
int *locs; // Shader locations array (RL_MAX_SHADER_LOCATIONS)
|
|
246
|
+
} Shader;
|
|
247
|
+
// MaterialMap
|
|
248
|
+
typedef struct MaterialMap {
|
|
249
|
+
Texture2D texture; // Material map texture
|
|
250
|
+
Color color; // Material map color
|
|
251
|
+
float value; // Material map value
|
|
252
|
+
} MaterialMap;
|
|
253
|
+
// Material, includes shader and maps
|
|
254
|
+
typedef struct Material {
|
|
255
|
+
Shader shader; // Material shader
|
|
256
|
+
MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS)
|
|
257
|
+
float params[4]; // Material generic parameters (if required)
|
|
258
|
+
} Material;
|
|
259
|
+
// Transform, vertex transformation data
|
|
260
|
+
typedef struct Transform {
|
|
261
|
+
Vector3 translation; // Translation
|
|
262
|
+
Quaternion rotation; // Rotation
|
|
263
|
+
Vector3 scale; // Scale
|
|
264
|
+
} Transform;
|
|
265
|
+
// Bone, skeletal animation bone
|
|
266
|
+
typedef struct BoneInfo {
|
|
267
|
+
char name[32]; // Bone name
|
|
268
|
+
int parent; // Bone parent
|
|
269
|
+
} BoneInfo;
|
|
270
|
+
// Model, meshes, materials and animation data
|
|
271
|
+
typedef struct Model {
|
|
272
|
+
Matrix transform; // Local transform matrix
|
|
273
|
+
int meshCount; // Number of meshes
|
|
274
|
+
int materialCount; // Number of materials
|
|
275
|
+
Mesh *meshes; // Meshes array
|
|
276
|
+
Material *materials; // Materials array
|
|
277
|
+
int *meshMaterial; // Mesh material number
|
|
278
|
+
// Animation data
|
|
279
|
+
int boneCount; // Number of bones
|
|
280
|
+
BoneInfo *bones; // Bones information (skeleton)
|
|
281
|
+
Transform *bindPose; // Bones base transformation (pose)
|
|
282
|
+
} Model;
|
|
283
|
+
// ModelAnimation
|
|
284
|
+
typedef struct ModelAnimation {
|
|
285
|
+
int boneCount; // Number of bones
|
|
286
|
+
int frameCount; // Number of animation frames
|
|
287
|
+
BoneInfo *bones; // Bones information (skeleton)
|
|
288
|
+
Transform **framePoses; // Poses array by frame
|
|
289
|
+
char name[32]; // Animation name
|
|
290
|
+
} ModelAnimation;
|
|
291
|
+
// Ray, ray for raycasting
|
|
292
|
+
typedef struct Ray {
|
|
293
|
+
Vector3 position; // Ray position (origin)
|
|
294
|
+
Vector3 direction; // Ray direction (normalized)
|
|
295
|
+
} Ray;
|
|
296
|
+
// RayCollision, ray hit information
|
|
297
|
+
typedef struct RayCollision {
|
|
298
|
+
bool hit; // Did the ray hit something?
|
|
299
|
+
float distance; // Distance to the nearest hit
|
|
300
|
+
Vector3 point; // Point of the nearest hit
|
|
301
|
+
Vector3 normal; // Surface normal of hit
|
|
302
|
+
} RayCollision;
|
|
303
|
+
// BoundingBox
|
|
304
|
+
typedef struct BoundingBox {
|
|
305
|
+
Vector3 min; // Minimum vertex box-corner
|
|
306
|
+
Vector3 max; // Maximum vertex box-corner
|
|
307
|
+
} BoundingBox;
|
|
308
|
+
// Wave, audio wave data
|
|
309
|
+
typedef struct Wave {
|
|
310
|
+
unsigned int frameCount; // Total number of frames (considering channels)
|
|
311
|
+
unsigned int sampleRate; // Frequency (samples per second)
|
|
312
|
+
unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
|
|
313
|
+
unsigned int channels; // Number of channels (1-mono, 2-stereo, ...)
|
|
314
|
+
void *data; // Buffer data pointer
|
|
315
|
+
} Wave;
|
|
316
|
+
// Opaque structs declaration
|
|
317
|
+
// NOTE: Actual structs are defined internally in raudio module
|
|
318
|
+
typedef struct rAudioBuffer rAudioBuffer;
|
|
319
|
+
typedef struct rAudioProcessor rAudioProcessor;
|
|
320
|
+
// AudioStream, custom audio stream
|
|
321
|
+
typedef struct AudioStream {
|
|
322
|
+
rAudioBuffer *buffer; // Pointer to internal data used by the audio system
|
|
323
|
+
rAudioProcessor *processor; // Pointer to internal data processor, useful for audio effects
|
|
324
|
+
unsigned int sampleRate; // Frequency (samples per second)
|
|
325
|
+
unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
|
|
326
|
+
unsigned int channels; // Number of channels (1-mono, 2-stereo, ...)
|
|
327
|
+
} AudioStream;
|
|
328
|
+
// Sound
|
|
329
|
+
typedef struct Sound {
|
|
330
|
+
AudioStream stream; // Audio stream
|
|
331
|
+
unsigned int frameCount; // Total number of frames (considering channels)
|
|
332
|
+
} Sound;
|
|
333
|
+
// Music, audio stream, anything longer than ~10 seconds should be streamed
|
|
334
|
+
typedef struct Music {
|
|
335
|
+
AudioStream stream; // Audio stream
|
|
336
|
+
unsigned int frameCount; // Total number of frames (considering channels)
|
|
337
|
+
bool looping; // Music looping enable
|
|
338
|
+
int ctxType; // Type of music context (audio filetype)
|
|
339
|
+
void *ctxData; // Audio context data, depends on type
|
|
340
|
+
} Music;
|
|
341
|
+
// VrDeviceInfo, Head-Mounted-Display device parameters
|
|
342
|
+
typedef struct VrDeviceInfo {
|
|
343
|
+
int hResolution; // Horizontal resolution in pixels
|
|
344
|
+
int vResolution; // Vertical resolution in pixels
|
|
345
|
+
float hScreenSize; // Horizontal size in meters
|
|
346
|
+
float vScreenSize; // Vertical size in meters
|
|
347
|
+
float eyeToScreenDistance; // Distance between eye and display in meters
|
|
348
|
+
float lensSeparationDistance; // Lens separation distance in meters
|
|
349
|
+
float interpupillaryDistance; // IPD (distance between pupils) in meters
|
|
350
|
+
float lensDistortionValues[4]; // Lens distortion constant parameters
|
|
351
|
+
float chromaAbCorrection[4]; // Chromatic aberration correction parameters
|
|
352
|
+
} VrDeviceInfo;
|
|
353
|
+
// VrStereoConfig, VR stereo rendering configuration for simulator
|
|
354
|
+
typedef struct VrStereoConfig {
|
|
355
|
+
Matrix projection[2]; // VR projection matrices (per eye)
|
|
356
|
+
Matrix viewOffset[2]; // VR view offset matrices (per eye)
|
|
357
|
+
float leftLensCenter[2]; // VR left lens center
|
|
358
|
+
float rightLensCenter[2]; // VR right lens center
|
|
359
|
+
float leftScreenCenter[2]; // VR left screen center
|
|
360
|
+
float rightScreenCenter[2]; // VR right screen center
|
|
361
|
+
float scale[2]; // VR distortion scale
|
|
362
|
+
float scaleIn[2]; // VR distortion scale in
|
|
363
|
+
} VrStereoConfig;
|
|
364
|
+
// File path list
|
|
365
|
+
typedef struct FilePathList {
|
|
366
|
+
unsigned int capacity; // Filepaths max entries
|
|
367
|
+
unsigned int count; // Filepaths entries count
|
|
368
|
+
char **paths; // Filepaths entries
|
|
369
|
+
} FilePathList;
|
|
370
|
+
// Automation event
|
|
371
|
+
typedef struct AutomationEvent {
|
|
372
|
+
unsigned int frame; // Event frame
|
|
373
|
+
unsigned int type; // Event type (AutomationEventType)
|
|
374
|
+
int params[4]; // Event parameters (if required)
|
|
375
|
+
} AutomationEvent;
|
|
376
|
+
// Automation event list
|
|
377
|
+
typedef struct AutomationEventList {
|
|
378
|
+
unsigned int capacity; // Events max entries (MAX_AUTOMATION_EVENTS)
|
|
379
|
+
unsigned int count; // Events entries count
|
|
380
|
+
AutomationEvent *events; // Events entries
|
|
381
|
+
} AutomationEventList;
|
|
382
|
+
//----------------------------------------------------------------------------------
|
|
383
|
+
// Enumerators Definition
|
|
384
|
+
//----------------------------------------------------------------------------------
|
|
385
|
+
// System/Window config flags
|
|
386
|
+
// NOTE: Every bit registers one state (use it with bit masks)
|
|
387
|
+
// By default all flags are set to 0
|
|
388
|
+
typedef enum {
|
|
389
|
+
FLAG_VSYNC_HINT = 0x00000040, // Set to try enabling V-Sync on GPU
|
|
390
|
+
FLAG_FULLSCREEN_MODE = 0x00000002, // Set to run program in fullscreen
|
|
391
|
+
FLAG_WINDOW_RESIZABLE = 0x00000004, // Set to allow resizable window
|
|
392
|
+
FLAG_WINDOW_UNDECORATED = 0x00000008, // Set to disable window decoration (frame and buttons)
|
|
393
|
+
FLAG_WINDOW_HIDDEN = 0x00000080, // Set to hide window
|
|
394
|
+
FLAG_WINDOW_MINIMIZED = 0x00000200, // Set to minimize window (iconify)
|
|
395
|
+
FLAG_WINDOW_MAXIMIZED = 0x00000400, // Set to maximize window (expanded to monitor)
|
|
396
|
+
FLAG_WINDOW_UNFOCUSED = 0x00000800, // Set to window non focused
|
|
397
|
+
FLAG_WINDOW_TOPMOST = 0x00001000, // Set to window always on top
|
|
398
|
+
FLAG_WINDOW_ALWAYS_RUN = 0x00000100, // Set to allow windows running while minimized
|
|
399
|
+
FLAG_WINDOW_TRANSPARENT = 0x00000010, // Set to allow transparent framebuffer
|
|
400
|
+
FLAG_WINDOW_HIGHDPI = 0x00002000, // Set to support HighDPI
|
|
401
|
+
FLAG_WINDOW_MOUSE_PASSTHROUGH = 0x00004000, // Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
|
|
402
|
+
FLAG_BORDERLESS_WINDOWED_MODE = 0x00008000, // Set to run program in borderless windowed mode
|
|
403
|
+
FLAG_MSAA_4X_HINT = 0x00000020, // Set to try enabling MSAA 4X
|
|
404
|
+
FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D)
|
|
405
|
+
} ConfigFlags;
|
|
406
|
+
// Trace log level
|
|
407
|
+
// NOTE: Organized by priority level
|
|
408
|
+
typedef enum {
|
|
409
|
+
LOG_ALL = 0, // Display all logs
|
|
410
|
+
LOG_TRACE, // Trace logging, intended for internal use only
|
|
411
|
+
LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds
|
|
412
|
+
LOG_INFO, // Info logging, used for program execution info
|
|
413
|
+
LOG_WARNING, // Warning logging, used on recoverable failures
|
|
414
|
+
LOG_ERROR, // Error logging, used on unrecoverable failures
|
|
415
|
+
LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE)
|
|
416
|
+
LOG_NONE // Disable logging
|
|
417
|
+
} TraceLogLevel;
|
|
418
|
+
// Keyboard keys (US keyboard layout)
|
|
419
|
+
// NOTE: Use GetKeyPressed() to allow redefining
|
|
420
|
+
// required keys for alternative layouts
|
|
421
|
+
typedef enum {
|
|
422
|
+
KEY_NULL = 0, // Key: NULL, used for no key pressed
|
|
423
|
+
// Alphanumeric keys
|
|
424
|
+
KEY_APOSTROPHE = 39, // Key: '
|
|
425
|
+
KEY_COMMA = 44, // Key: ,
|
|
426
|
+
KEY_MINUS = 45, // Key: -
|
|
427
|
+
KEY_PERIOD = 46, // Key: .
|
|
428
|
+
KEY_SLASH = 47, // Key: /
|
|
429
|
+
KEY_ZERO = 48, // Key: 0
|
|
430
|
+
KEY_ONE = 49, // Key: 1
|
|
431
|
+
KEY_TWO = 50, // Key: 2
|
|
432
|
+
KEY_THREE = 51, // Key: 3
|
|
433
|
+
KEY_FOUR = 52, // Key: 4
|
|
434
|
+
KEY_FIVE = 53, // Key: 5
|
|
435
|
+
KEY_SIX = 54, // Key: 6
|
|
436
|
+
KEY_SEVEN = 55, // Key: 7
|
|
437
|
+
KEY_EIGHT = 56, // Key: 8
|
|
438
|
+
KEY_NINE = 57, // Key: 9
|
|
439
|
+
KEY_SEMICOLON = 59, // Key: ;
|
|
440
|
+
KEY_EQUAL = 61, // Key: =
|
|
441
|
+
KEY_A = 65, // Key: A | a
|
|
442
|
+
KEY_B = 66, // Key: B | b
|
|
443
|
+
KEY_C = 67, // Key: C | c
|
|
444
|
+
KEY_D = 68, // Key: D | d
|
|
445
|
+
KEY_E = 69, // Key: E | e
|
|
446
|
+
KEY_F = 70, // Key: F | f
|
|
447
|
+
KEY_G = 71, // Key: G | g
|
|
448
|
+
KEY_H = 72, // Key: H | h
|
|
449
|
+
KEY_I = 73, // Key: I | i
|
|
450
|
+
KEY_J = 74, // Key: J | j
|
|
451
|
+
KEY_K = 75, // Key: K | k
|
|
452
|
+
KEY_L = 76, // Key: L | l
|
|
453
|
+
KEY_M = 77, // Key: M | m
|
|
454
|
+
KEY_N = 78, // Key: N | n
|
|
455
|
+
KEY_O = 79, // Key: O | o
|
|
456
|
+
KEY_P = 80, // Key: P | p
|
|
457
|
+
KEY_Q = 81, // Key: Q | q
|
|
458
|
+
KEY_R = 82, // Key: R | r
|
|
459
|
+
KEY_S = 83, // Key: S | s
|
|
460
|
+
KEY_T = 84, // Key: T | t
|
|
461
|
+
KEY_U = 85, // Key: U | u
|
|
462
|
+
KEY_V = 86, // Key: V | v
|
|
463
|
+
KEY_W = 87, // Key: W | w
|
|
464
|
+
KEY_X = 88, // Key: X | x
|
|
465
|
+
KEY_Y = 89, // Key: Y | y
|
|
466
|
+
KEY_Z = 90, // Key: Z | z
|
|
467
|
+
KEY_LEFT_BRACKET = 91, // Key: [
|
|
468
|
+
KEY_BACKSLASH = 92, // Key: '\'
|
|
469
|
+
KEY_RIGHT_BRACKET = 93, // Key: ]
|
|
470
|
+
KEY_GRAVE = 96, // Key: `
|
|
471
|
+
// Function keys
|
|
472
|
+
KEY_SPACE = 32, // Key: Space
|
|
473
|
+
KEY_ESCAPE = 256, // Key: Esc
|
|
474
|
+
KEY_ENTER = 257, // Key: Enter
|
|
475
|
+
KEY_TAB = 258, // Key: Tab
|
|
476
|
+
KEY_BACKSPACE = 259, // Key: Backspace
|
|
477
|
+
KEY_INSERT = 260, // Key: Ins
|
|
478
|
+
KEY_DELETE = 261, // Key: Del
|
|
479
|
+
KEY_RIGHT = 262, // Key: Cursor right
|
|
480
|
+
KEY_LEFT = 263, // Key: Cursor left
|
|
481
|
+
KEY_DOWN = 264, // Key: Cursor down
|
|
482
|
+
KEY_UP = 265, // Key: Cursor up
|
|
483
|
+
KEY_PAGE_UP = 266, // Key: Page up
|
|
484
|
+
KEY_PAGE_DOWN = 267, // Key: Page down
|
|
485
|
+
KEY_HOME = 268, // Key: Home
|
|
486
|
+
KEY_END = 269, // Key: End
|
|
487
|
+
KEY_CAPS_LOCK = 280, // Key: Caps lock
|
|
488
|
+
KEY_SCROLL_LOCK = 281, // Key: Scroll down
|
|
489
|
+
KEY_NUM_LOCK = 282, // Key: Num lock
|
|
490
|
+
KEY_PRINT_SCREEN = 283, // Key: Print screen
|
|
491
|
+
KEY_PAUSE = 284, // Key: Pause
|
|
492
|
+
KEY_F1 = 290, // Key: F1
|
|
493
|
+
KEY_F2 = 291, // Key: F2
|
|
494
|
+
KEY_F3 = 292, // Key: F3
|
|
495
|
+
KEY_F4 = 293, // Key: F4
|
|
496
|
+
KEY_F5 = 294, // Key: F5
|
|
497
|
+
KEY_F6 = 295, // Key: F6
|
|
498
|
+
KEY_F7 = 296, // Key: F7
|
|
499
|
+
KEY_F8 = 297, // Key: F8
|
|
500
|
+
KEY_F9 = 298, // Key: F9
|
|
501
|
+
KEY_F10 = 299, // Key: F10
|
|
502
|
+
KEY_F11 = 300, // Key: F11
|
|
503
|
+
KEY_F12 = 301, // Key: F12
|
|
504
|
+
KEY_LEFT_SHIFT = 340, // Key: Shift left
|
|
505
|
+
KEY_LEFT_CONTROL = 341, // Key: Control left
|
|
506
|
+
KEY_LEFT_ALT = 342, // Key: Alt left
|
|
507
|
+
KEY_LEFT_SUPER = 343, // Key: Super left
|
|
508
|
+
KEY_RIGHT_SHIFT = 344, // Key: Shift right
|
|
509
|
+
KEY_RIGHT_CONTROL = 345, // Key: Control right
|
|
510
|
+
KEY_RIGHT_ALT = 346, // Key: Alt right
|
|
511
|
+
KEY_RIGHT_SUPER = 347, // Key: Super right
|
|
512
|
+
KEY_KB_MENU = 348, // Key: KB menu
|
|
513
|
+
// Keypad keys
|
|
514
|
+
KEY_KP_0 = 320, // Key: Keypad 0
|
|
515
|
+
KEY_KP_1 = 321, // Key: Keypad 1
|
|
516
|
+
KEY_KP_2 = 322, // Key: Keypad 2
|
|
517
|
+
KEY_KP_3 = 323, // Key: Keypad 3
|
|
518
|
+
KEY_KP_4 = 324, // Key: Keypad 4
|
|
519
|
+
KEY_KP_5 = 325, // Key: Keypad 5
|
|
520
|
+
KEY_KP_6 = 326, // Key: Keypad 6
|
|
521
|
+
KEY_KP_7 = 327, // Key: Keypad 7
|
|
522
|
+
KEY_KP_8 = 328, // Key: Keypad 8
|
|
523
|
+
KEY_KP_9 = 329, // Key: Keypad 9
|
|
524
|
+
KEY_KP_DECIMAL = 330, // Key: Keypad .
|
|
525
|
+
KEY_KP_DIVIDE = 331, // Key: Keypad /
|
|
526
|
+
KEY_KP_MULTIPLY = 332, // Key: Keypad *
|
|
527
|
+
KEY_KP_SUBTRACT = 333, // Key: Keypad -
|
|
528
|
+
KEY_KP_ADD = 334, // Key: Keypad +
|
|
529
|
+
KEY_KP_ENTER = 335, // Key: Keypad Enter
|
|
530
|
+
KEY_KP_EQUAL = 336, // Key: Keypad =
|
|
531
|
+
// Android key buttons
|
|
532
|
+
KEY_BACK = 4, // Key: Android back button
|
|
533
|
+
KEY_MENU = 5, // Key: Android menu button
|
|
534
|
+
KEY_VOLUME_UP = 24, // Key: Android volume up button
|
|
535
|
+
KEY_VOLUME_DOWN = 25 // Key: Android volume down button
|
|
536
|
+
} KeyboardKey;
|
|
537
|
+
// Add backwards compatibility support for deprecated names
|
|
538
|
+
// Mouse buttons
|
|
539
|
+
typedef enum {
|
|
540
|
+
MOUSE_BUTTON_LEFT = 0, // Mouse button left
|
|
541
|
+
MOUSE_BUTTON_RIGHT = 1, // Mouse button right
|
|
542
|
+
MOUSE_BUTTON_MIDDLE = 2, // Mouse button middle (pressed wheel)
|
|
543
|
+
MOUSE_BUTTON_SIDE = 3, // Mouse button side (advanced mouse device)
|
|
544
|
+
MOUSE_BUTTON_EXTRA = 4, // Mouse button extra (advanced mouse device)
|
|
545
|
+
MOUSE_BUTTON_FORWARD = 5, // Mouse button forward (advanced mouse device)
|
|
546
|
+
MOUSE_BUTTON_BACK = 6, // Mouse button back (advanced mouse device)
|
|
547
|
+
} MouseButton;
|
|
548
|
+
// Mouse cursor
|
|
549
|
+
typedef enum {
|
|
550
|
+
MOUSE_CURSOR_DEFAULT = 0, // Default pointer shape
|
|
551
|
+
MOUSE_CURSOR_ARROW = 1, // Arrow shape
|
|
552
|
+
MOUSE_CURSOR_IBEAM = 2, // Text writing cursor shape
|
|
553
|
+
MOUSE_CURSOR_CROSSHAIR = 3, // Cross shape
|
|
554
|
+
MOUSE_CURSOR_POINTING_HAND = 4, // Pointing hand cursor
|
|
555
|
+
MOUSE_CURSOR_RESIZE_EW = 5, // Horizontal resize/move arrow shape
|
|
556
|
+
MOUSE_CURSOR_RESIZE_NS = 6, // Vertical resize/move arrow shape
|
|
557
|
+
MOUSE_CURSOR_RESIZE_NWSE = 7, // Top-left to bottom-right diagonal resize/move arrow shape
|
|
558
|
+
MOUSE_CURSOR_RESIZE_NESW = 8, // The top-right to bottom-left diagonal resize/move arrow shape
|
|
559
|
+
MOUSE_CURSOR_RESIZE_ALL = 9, // The omnidirectional resize/move cursor shape
|
|
560
|
+
MOUSE_CURSOR_NOT_ALLOWED = 10 // The operation-not-allowed shape
|
|
561
|
+
} MouseCursor;
|
|
562
|
+
// Gamepad buttons
|
|
563
|
+
typedef enum {
|
|
564
|
+
GAMEPAD_BUTTON_UNKNOWN = 0, // Unknown button, just for error checking
|
|
565
|
+
GAMEPAD_BUTTON_LEFT_FACE_UP, // Gamepad left DPAD up button
|
|
566
|
+
GAMEPAD_BUTTON_LEFT_FACE_RIGHT, // Gamepad left DPAD right button
|
|
567
|
+
GAMEPAD_BUTTON_LEFT_FACE_DOWN, // Gamepad left DPAD down button
|
|
568
|
+
GAMEPAD_BUTTON_LEFT_FACE_LEFT, // Gamepad left DPAD left button
|
|
569
|
+
GAMEPAD_BUTTON_RIGHT_FACE_UP, // Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
|
|
570
|
+
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, // Gamepad right button right (i.e. PS3: Circle, Xbox: B)
|
|
571
|
+
GAMEPAD_BUTTON_RIGHT_FACE_DOWN, // Gamepad right button down (i.e. PS3: Cross, Xbox: A)
|
|
572
|
+
GAMEPAD_BUTTON_RIGHT_FACE_LEFT, // Gamepad right button left (i.e. PS3: Square, Xbox: X)
|
|
573
|
+
GAMEPAD_BUTTON_LEFT_TRIGGER_1, // Gamepad top/back trigger left (first), it could be a trailing button
|
|
574
|
+
GAMEPAD_BUTTON_LEFT_TRIGGER_2, // Gamepad top/back trigger left (second), it could be a trailing button
|
|
575
|
+
GAMEPAD_BUTTON_RIGHT_TRIGGER_1, // Gamepad top/back trigger right (first), it could be a trailing button
|
|
576
|
+
GAMEPAD_BUTTON_RIGHT_TRIGGER_2, // Gamepad top/back trigger right (second), it could be a trailing button
|
|
577
|
+
GAMEPAD_BUTTON_MIDDLE_LEFT, // Gamepad center buttons, left one (i.e. PS3: Select)
|
|
578
|
+
GAMEPAD_BUTTON_MIDDLE, // Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
|
|
579
|
+
GAMEPAD_BUTTON_MIDDLE_RIGHT, // Gamepad center buttons, right one (i.e. PS3: Start)
|
|
580
|
+
GAMEPAD_BUTTON_LEFT_THUMB, // Gamepad joystick pressed button left
|
|
581
|
+
GAMEPAD_BUTTON_RIGHT_THUMB // Gamepad joystick pressed button right
|
|
582
|
+
} GamepadButton;
|
|
583
|
+
// Gamepad axis
|
|
584
|
+
typedef enum {
|
|
585
|
+
GAMEPAD_AXIS_LEFT_X = 0, // Gamepad left stick X axis
|
|
586
|
+
GAMEPAD_AXIS_LEFT_Y = 1, // Gamepad left stick Y axis
|
|
587
|
+
GAMEPAD_AXIS_RIGHT_X = 2, // Gamepad right stick X axis
|
|
588
|
+
GAMEPAD_AXIS_RIGHT_Y = 3, // Gamepad right stick Y axis
|
|
589
|
+
GAMEPAD_AXIS_LEFT_TRIGGER = 4, // Gamepad back trigger left, pressure level: [1..-1]
|
|
590
|
+
GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // Gamepad back trigger right, pressure level: [1..-1]
|
|
591
|
+
} GamepadAxis;
|
|
592
|
+
// Material map index
|
|
593
|
+
typedef enum {
|
|
594
|
+
MATERIAL_MAP_ALBEDO = 0, // Albedo material (same as: MATERIAL_MAP_DIFFUSE)
|
|
595
|
+
MATERIAL_MAP_METALNESS, // Metalness material (same as: MATERIAL_MAP_SPECULAR)
|
|
596
|
+
MATERIAL_MAP_NORMAL, // Normal material
|
|
597
|
+
MATERIAL_MAP_ROUGHNESS, // Roughness material
|
|
598
|
+
MATERIAL_MAP_OCCLUSION, // Ambient occlusion material
|
|
599
|
+
MATERIAL_MAP_EMISSION, // Emission material
|
|
600
|
+
MATERIAL_MAP_HEIGHT, // Heightmap material
|
|
601
|
+
MATERIAL_MAP_CUBEMAP, // Cubemap material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
|
|
602
|
+
MATERIAL_MAP_IRRADIANCE, // Irradiance material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
|
|
603
|
+
MATERIAL_MAP_PREFILTER, // Prefilter material (NOTE: Uses GL_TEXTURE_CUBE_MAP)
|
|
604
|
+
MATERIAL_MAP_BRDF // Brdf material
|
|
605
|
+
} MaterialMapIndex;
|
|
606
|
+
// Shader location index
|
|
607
|
+
typedef enum {
|
|
608
|
+
SHADER_LOC_VERTEX_POSITION = 0, // Shader location: vertex attribute: position
|
|
609
|
+
SHADER_LOC_VERTEX_TEXCOORD01, // Shader location: vertex attribute: texcoord01
|
|
610
|
+
SHADER_LOC_VERTEX_TEXCOORD02, // Shader location: vertex attribute: texcoord02
|
|
611
|
+
SHADER_LOC_VERTEX_NORMAL, // Shader location: vertex attribute: normal
|
|
612
|
+
SHADER_LOC_VERTEX_TANGENT, // Shader location: vertex attribute: tangent
|
|
613
|
+
SHADER_LOC_VERTEX_COLOR, // Shader location: vertex attribute: color
|
|
614
|
+
SHADER_LOC_MATRIX_MVP, // Shader location: matrix uniform: model-view-projection
|
|
615
|
+
SHADER_LOC_MATRIX_VIEW, // Shader location: matrix uniform: view (camera transform)
|
|
616
|
+
SHADER_LOC_MATRIX_PROJECTION, // Shader location: matrix uniform: projection
|
|
617
|
+
SHADER_LOC_MATRIX_MODEL, // Shader location: matrix uniform: model (transform)
|
|
618
|
+
SHADER_LOC_MATRIX_NORMAL, // Shader location: matrix uniform: normal
|
|
619
|
+
SHADER_LOC_VECTOR_VIEW, // Shader location: vector uniform: view
|
|
620
|
+
SHADER_LOC_COLOR_DIFFUSE, // Shader location: vector uniform: diffuse color
|
|
621
|
+
SHADER_LOC_COLOR_SPECULAR, // Shader location: vector uniform: specular color
|
|
622
|
+
SHADER_LOC_COLOR_AMBIENT, // Shader location: vector uniform: ambient color
|
|
623
|
+
SHADER_LOC_MAP_ALBEDO, // Shader location: sampler2d texture: albedo (same as: SHADER_LOC_MAP_DIFFUSE)
|
|
624
|
+
SHADER_LOC_MAP_METALNESS, // Shader location: sampler2d texture: metalness (same as: SHADER_LOC_MAP_SPECULAR)
|
|
625
|
+
SHADER_LOC_MAP_NORMAL, // Shader location: sampler2d texture: normal
|
|
626
|
+
SHADER_LOC_MAP_ROUGHNESS, // Shader location: sampler2d texture: roughness
|
|
627
|
+
SHADER_LOC_MAP_OCCLUSION, // Shader location: sampler2d texture: occlusion
|
|
628
|
+
SHADER_LOC_MAP_EMISSION, // Shader location: sampler2d texture: emission
|
|
629
|
+
SHADER_LOC_MAP_HEIGHT, // Shader location: sampler2d texture: height
|
|
630
|
+
SHADER_LOC_MAP_CUBEMAP, // Shader location: samplerCube texture: cubemap
|
|
631
|
+
SHADER_LOC_MAP_IRRADIANCE, // Shader location: samplerCube texture: irradiance
|
|
632
|
+
SHADER_LOC_MAP_PREFILTER, // Shader location: samplerCube texture: prefilter
|
|
633
|
+
SHADER_LOC_MAP_BRDF, // Shader location: sampler2d texture: brdf
|
|
634
|
+
SHADER_LOC_VERTEX_BONEIDS, // Shader location: vertex attribute: boneIds
|
|
635
|
+
SHADER_LOC_VERTEX_BONEWEIGHTS, // Shader location: vertex attribute: boneWeights
|
|
636
|
+
SHADER_LOC_BONE_MATRICES // Shader location: array of matrices uniform: boneMatrices
|
|
637
|
+
} ShaderLocationIndex;
|
|
638
|
+
// Shader uniform data type
|
|
639
|
+
typedef enum {
|
|
640
|
+
SHADER_UNIFORM_FLOAT = 0, // Shader uniform type: float
|
|
641
|
+
SHADER_UNIFORM_VEC2, // Shader uniform type: vec2 (2 float)
|
|
642
|
+
SHADER_UNIFORM_VEC3, // Shader uniform type: vec3 (3 float)
|
|
643
|
+
SHADER_UNIFORM_VEC4, // Shader uniform type: vec4 (4 float)
|
|
644
|
+
SHADER_UNIFORM_INT, // Shader uniform type: int
|
|
645
|
+
SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int)
|
|
646
|
+
SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int)
|
|
647
|
+
SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int)
|
|
648
|
+
SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d
|
|
649
|
+
} ShaderUniformDataType;
|
|
650
|
+
// Shader attribute data types
|
|
651
|
+
typedef enum {
|
|
652
|
+
SHADER_ATTRIB_FLOAT = 0, // Shader attribute type: float
|
|
653
|
+
SHADER_ATTRIB_VEC2, // Shader attribute type: vec2 (2 float)
|
|
654
|
+
SHADER_ATTRIB_VEC3, // Shader attribute type: vec3 (3 float)
|
|
655
|
+
SHADER_ATTRIB_VEC4 // Shader attribute type: vec4 (4 float)
|
|
656
|
+
} ShaderAttributeDataType;
|
|
657
|
+
// Pixel formats
|
|
658
|
+
// NOTE: Support depends on OpenGL version and platform
|
|
659
|
+
typedef enum {
|
|
660
|
+
PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha)
|
|
661
|
+
PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels)
|
|
662
|
+
PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp
|
|
663
|
+
PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp
|
|
664
|
+
PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha)
|
|
665
|
+
PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha)
|
|
666
|
+
PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp
|
|
667
|
+
PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
|
|
668
|
+
PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
|
|
669
|
+
PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
|
|
670
|
+
PIXELFORMAT_UNCOMPRESSED_R16, // 16 bpp (1 channel - half float)
|
|
671
|
+
PIXELFORMAT_UNCOMPRESSED_R16G16B16, // 16*3 bpp (3 channels - half float)
|
|
672
|
+
PIXELFORMAT_UNCOMPRESSED_R16G16B16A16, // 16*4 bpp (4 channels - half float)
|
|
673
|
+
PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
|
|
674
|
+
PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
|
|
675
|
+
PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp
|
|
676
|
+
PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp
|
|
677
|
+
PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp
|
|
678
|
+
PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp
|
|
679
|
+
PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp
|
|
680
|
+
PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp
|
|
681
|
+
PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp
|
|
682
|
+
PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp
|
|
683
|
+
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp
|
|
684
|
+
} PixelFormat;
|
|
685
|
+
// Texture parameters: filter mode
|
|
686
|
+
// NOTE 1: Filtering considers mipmaps if available in the texture
|
|
687
|
+
// NOTE 2: Filter is accordingly set for minification and magnification
|
|
688
|
+
typedef enum {
|
|
689
|
+
TEXTURE_FILTER_POINT = 0, // No filter, just pixel approximation
|
|
690
|
+
TEXTURE_FILTER_BILINEAR, // Linear filtering
|
|
691
|
+
TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps)
|
|
692
|
+
TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x
|
|
693
|
+
TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x
|
|
694
|
+
TEXTURE_FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x
|
|
695
|
+
} TextureFilter;
|
|
696
|
+
// Texture parameters: wrap mode
|
|
697
|
+
typedef enum {
|
|
698
|
+
TEXTURE_WRAP_REPEAT = 0, // Repeats texture in tiled mode
|
|
699
|
+
TEXTURE_WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode
|
|
700
|
+
TEXTURE_WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode
|
|
701
|
+
TEXTURE_WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode
|
|
702
|
+
} TextureWrap;
|
|
703
|
+
// Cubemap layouts
|
|
704
|
+
typedef enum {
|
|
705
|
+
CUBEMAP_LAYOUT_AUTO_DETECT = 0, // Automatically detect layout type
|
|
706
|
+
CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces
|
|
707
|
+
CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by a horizontal line with faces
|
|
708
|
+
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces
|
|
709
|
+
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE // Layout is defined by a 4x3 cross with cubemap faces
|
|
710
|
+
} CubemapLayout;
|
|
711
|
+
// Font type, defines generation method
|
|
712
|
+
typedef enum {
|
|
713
|
+
FONT_DEFAULT = 0, // Default font generation, anti-aliased
|
|
714
|
+
FONT_BITMAP, // Bitmap font generation, no anti-aliasing
|
|
715
|
+
FONT_SDF // SDF font generation, requires external shader
|
|
716
|
+
} FontType;
|
|
717
|
+
// Color blending modes (pre-defined)
|
|
718
|
+
typedef enum {
|
|
719
|
+
BLEND_ALPHA = 0, // Blend textures considering alpha (default)
|
|
720
|
+
BLEND_ADDITIVE, // Blend textures adding colors
|
|
721
|
+
BLEND_MULTIPLIED, // Blend textures multiplying colors
|
|
722
|
+
BLEND_ADD_COLORS, // Blend textures adding colors (alternative)
|
|
723
|
+
BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative)
|
|
724
|
+
BLEND_ALPHA_PREMULTIPLY, // Blend premultiplied textures considering alpha
|
|
725
|
+
BLEND_CUSTOM, // Blend textures using custom src/dst factors (use rlSetBlendFactors())
|
|
726
|
+
BLEND_CUSTOM_SEPARATE // Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())
|
|
727
|
+
} BlendMode;
|
|
728
|
+
// Gesture
|
|
729
|
+
// NOTE: Provided as bit-wise flags to enable only desired gestures
|
|
730
|
+
typedef enum {
|
|
731
|
+
GESTURE_NONE = 0, // No gesture
|
|
732
|
+
GESTURE_TAP = 1, // Tap gesture
|
|
733
|
+
GESTURE_DOUBLETAP = 2, // Double tap gesture
|
|
734
|
+
GESTURE_HOLD = 4, // Hold gesture
|
|
735
|
+
GESTURE_DRAG = 8, // Drag gesture
|
|
736
|
+
GESTURE_SWIPE_RIGHT = 16, // Swipe right gesture
|
|
737
|
+
GESTURE_SWIPE_LEFT = 32, // Swipe left gesture
|
|
738
|
+
GESTURE_SWIPE_UP = 64, // Swipe up gesture
|
|
739
|
+
GESTURE_SWIPE_DOWN = 128, // Swipe down gesture
|
|
740
|
+
GESTURE_PINCH_IN = 256, // Pinch in gesture
|
|
741
|
+
GESTURE_PINCH_OUT = 512 // Pinch out gesture
|
|
742
|
+
} Gesture;
|
|
743
|
+
// Camera system modes
|
|
744
|
+
typedef enum {
|
|
745
|
+
CAMERA_CUSTOM = 0, // Camera custom, controlled by user (UpdateCamera() does nothing)
|
|
746
|
+
CAMERA_FREE, // Camera free mode
|
|
747
|
+
CAMERA_ORBITAL, // Camera orbital, around target, zoom supported
|
|
748
|
+
CAMERA_FIRST_PERSON, // Camera first person
|
|
749
|
+
CAMERA_THIRD_PERSON // Camera third person
|
|
750
|
+
} CameraMode;
|
|
751
|
+
// Camera projection
|
|
752
|
+
typedef enum {
|
|
753
|
+
CAMERA_PERSPECTIVE = 0, // Perspective projection
|
|
754
|
+
CAMERA_ORTHOGRAPHIC // Orthographic projection
|
|
755
|
+
} CameraProjection;
|
|
756
|
+
// N-patch layout
|
|
757
|
+
typedef enum {
|
|
758
|
+
NPATCH_NINE_PATCH = 0, // Npatch layout: 3x3 tiles
|
|
759
|
+
NPATCH_THREE_PATCH_VERTICAL, // Npatch layout: 1x3 tiles
|
|
760
|
+
NPATCH_THREE_PATCH_HORIZONTAL // Npatch layout: 3x1 tiles
|
|
761
|
+
} NPatchLayout;
|
|
762
|
+
// Callbacks to hook some internal functions
|
|
763
|
+
// WARNING: These callbacks are intended for advanced users
|
|
764
|
+
typedef void (*TraceLogCallback)(int logLevel, const char *text, void * args); // Logging: Redirect trace log messages
|
|
765
|
+
typedef unsigned char *(*LoadFileDataCallback)(const char *fileName, int *dataSize); // FileIO: Load binary data
|
|
766
|
+
typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, int dataSize); // FileIO: Save binary data
|
|
767
|
+
typedef char *(*LoadFileTextCallback)(const char *fileName); // FileIO: Load text data
|
|
768
|
+
typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data
|
|
769
|
+
//------------------------------------------------------------------------------------
|
|
770
|
+
// Global Variables Definition
|
|
771
|
+
//------------------------------------------------------------------------------------
|
|
772
|
+
// It's lonely here...
|
|
773
|
+
//------------------------------------------------------------------------------------
|
|
774
|
+
// Window and Graphics Device Functions (Module: core)
|
|
775
|
+
//------------------------------------------------------------------------------------
|
|
776
|
+
// Window-related functions
|
|
777
|
+
void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context
|
|
778
|
+
void CloseWindow(void); // Close window and unload OpenGL context
|
|
779
|
+
bool WindowShouldClose(void); // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
|
|
780
|
+
bool IsWindowReady(void); // Check if window has been initialized successfully
|
|
781
|
+
bool IsWindowFullscreen(void); // Check if window is currently fullscreen
|
|
782
|
+
bool IsWindowHidden(void); // Check if window is currently hidden
|
|
783
|
+
bool IsWindowMinimized(void); // Check if window is currently minimized
|
|
784
|
+
bool IsWindowMaximized(void); // Check if window is currently maximized
|
|
785
|
+
bool IsWindowFocused(void); // Check if window is currently focused
|
|
786
|
+
bool IsWindowResized(void); // Check if window has been resized last frame
|
|
787
|
+
bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled
|
|
788
|
+
void SetWindowState(unsigned int flags); // Set window configuration state using flags
|
|
789
|
+
void ClearWindowState(unsigned int flags); // Clear window configuration state flags
|
|
790
|
+
void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed, resizes monitor to match window resolution
|
|
791
|
+
void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution
|
|
792
|
+
void MaximizeWindow(void); // Set window state: maximized, if resizable
|
|
793
|
+
void MinimizeWindow(void); // Set window state: minimized, if resizable
|
|
794
|
+
void RestoreWindow(void); // Set window state: not minimized/maximized
|
|
795
|
+
void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit)
|
|
796
|
+
void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit)
|
|
797
|
+
void SetWindowTitle(const char *title); // Set title for window
|
|
798
|
+
void SetWindowPosition(int x, int y); // Set window position on screen
|
|
799
|
+
void SetWindowMonitor(int monitor); // Set monitor for the current window
|
|
800
|
+
void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
|
|
801
|
+
void SetWindowMaxSize(int width, int height); // Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
|
|
802
|
+
void SetWindowSize(int width, int height); // Set window dimensions
|
|
803
|
+
void SetWindowOpacity(float opacity); // Set window opacity [0.0f..1.0f]
|
|
804
|
+
void SetWindowFocused(void); // Set window focused
|
|
805
|
+
void *GetWindowHandle(void); // Get native window handle
|
|
806
|
+
int GetScreenWidth(void); // Get current screen width
|
|
807
|
+
int GetScreenHeight(void); // Get current screen height
|
|
808
|
+
int GetRenderWidth(void); // Get current render width (it considers HiDPI)
|
|
809
|
+
int GetRenderHeight(void); // Get current render height (it considers HiDPI)
|
|
810
|
+
int GetMonitorCount(void); // Get number of connected monitors
|
|
811
|
+
int GetCurrentMonitor(void); // Get current monitor where window is placed
|
|
812
|
+
Vector2 GetMonitorPosition(int monitor); // Get specified monitor position
|
|
813
|
+
int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor)
|
|
814
|
+
int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor)
|
|
815
|
+
int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres
|
|
816
|
+
int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres
|
|
817
|
+
int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate
|
|
818
|
+
Vector2 GetWindowPosition(void); // Get window position XY on monitor
|
|
819
|
+
Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor
|
|
820
|
+
const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitor
|
|
821
|
+
void SetClipboardText(const char *text); // Set clipboard text content
|
|
822
|
+
const char *GetClipboardText(void); // Get clipboard text content
|
|
823
|
+
Image GetClipboardImage(void); // Get clipboard image content
|
|
824
|
+
void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling
|
|
825
|
+
void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling
|
|
826
|
+
// Cursor-related functions
|
|
827
|
+
void ShowCursor(void); // Shows cursor
|
|
828
|
+
void HideCursor(void); // Hides cursor
|
|
829
|
+
bool IsCursorHidden(void); // Check if cursor is not visible
|
|
830
|
+
void EnableCursor(void); // Enables cursor (unlock cursor)
|
|
831
|
+
void DisableCursor(void); // Disables cursor (lock cursor)
|
|
832
|
+
bool IsCursorOnScreen(void); // Check if cursor is on the screen
|
|
833
|
+
// Drawing-related functions
|
|
834
|
+
void ClearBackground(Color color); // Set background color (framebuffer clear color)
|
|
835
|
+
void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing
|
|
836
|
+
void EndDrawing(void); // End canvas drawing and swap buffers (double buffering)
|
|
837
|
+
void BeginMode2D(Camera2D camera); // Begin 2D mode with custom camera (2D)
|
|
838
|
+
void EndMode2D(void); // Ends 2D mode with custom camera
|
|
839
|
+
void BeginMode3D(Camera3D camera); // Begin 3D mode with custom camera (3D)
|
|
840
|
+
void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode
|
|
841
|
+
void BeginTextureMode(RenderTexture2D target); // Begin drawing to render texture
|
|
842
|
+
void EndTextureMode(void); // Ends drawing to render texture
|
|
843
|
+
void BeginShaderMode(Shader shader); // Begin custom shader drawing
|
|
844
|
+
void EndShaderMode(void); // End custom shader drawing (use default shader)
|
|
845
|
+
void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied, subtract, custom)
|
|
846
|
+
void EndBlendMode(void); // End blending mode (reset to default: alpha blending)
|
|
847
|
+
void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing)
|
|
848
|
+
void EndScissorMode(void); // End scissor mode
|
|
849
|
+
void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator)
|
|
850
|
+
void EndVrStereoMode(void); // End stereo rendering (requires VR simulator)
|
|
851
|
+
// VR stereo config functions for VR simulator
|
|
852
|
+
VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); // Load VR stereo config for VR simulator device parameters
|
|
853
|
+
void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR stereo config
|
|
854
|
+
// Shader management functions
|
|
855
|
+
// NOTE: Shader functionality is not available on OpenGL 1.1
|
|
856
|
+
Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations
|
|
857
|
+
Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations
|
|
858
|
+
bool IsShaderValid(Shader shader); // Check if a shader is valid (loaded on GPU)
|
|
859
|
+
int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
|
|
860
|
+
int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location
|
|
861
|
+
void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value
|
|
862
|
+
void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector
|
|
863
|
+
void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4)
|
|
864
|
+
void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d)
|
|
865
|
+
void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM)
|
|
866
|
+
// Screen-space-related functions
|
|
867
|
+
Ray GetScreenToWorldRay(Vector2 position, Camera camera); // Get a ray trace from screen position (i.e mouse)
|
|
868
|
+
Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height); // Get a ray trace from screen position (i.e mouse) in a viewport
|
|
869
|
+
Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Get the screen space position for a 3d world space position
|
|
870
|
+
Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Get size position for a 3d world space position
|
|
871
|
+
Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Get the screen space position for a 2d camera world space position
|
|
872
|
+
Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Get the world space position for a 2d camera screen space position
|
|
873
|
+
Matrix GetCameraMatrix(Camera camera); // Get camera transform matrix (view matrix)
|
|
874
|
+
Matrix GetCameraMatrix2D(Camera2D camera); // Get camera 2d transform matrix
|
|
875
|
+
// Timing-related functions
|
|
876
|
+
void SetTargetFPS(int fps); // Set target FPS (maximum)
|
|
877
|
+
float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
|
|
878
|
+
double GetTime(void); // Get elapsed time in seconds since InitWindow()
|
|
879
|
+
int GetFPS(void); // Get current FPS
|
|
880
|
+
// Custom frame control functions
|
|
881
|
+
// NOTE: Those functions are intended for advanced users that want full control over the frame processing
|
|
882
|
+
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
|
|
883
|
+
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
|
|
884
|
+
void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing)
|
|
885
|
+
void PollInputEvents(void); // Register all input events
|
|
886
|
+
void WaitTime(double seconds); // Wait for some time (halt program execution)
|
|
887
|
+
// Random values generation functions
|
|
888
|
+
void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator
|
|
889
|
+
int GetRandomValue(int min, int max); // Get a random value between min and max (both included)
|
|
890
|
+
int *LoadRandomSequence(unsigned int count, int min, int max); // Load random values sequence, no values repeated
|
|
891
|
+
void UnloadRandomSequence(int *sequence); // Unload random values sequence
|
|
892
|
+
// Misc. functions
|
|
893
|
+
void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format)
|
|
894
|
+
void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS)
|
|
895
|
+
void OpenURL(const char *url); // Open URL with default system browser (if available)
|
|
896
|
+
// NOTE: Following functions implemented in module [utils]
|
|
897
|
+
//------------------------------------------------------------------
|
|
898
|
+
void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
|
|
899
|
+
void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level
|
|
900
|
+
void *MemAlloc(unsigned int size); // Internal memory allocator
|
|
901
|
+
void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
|
|
902
|
+
void MemFree(void *ptr); // Internal memory free
|
|
903
|
+
// Set custom callbacks
|
|
904
|
+
// WARNING: Callbacks setup is intended for advanced users
|
|
905
|
+
void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
|
|
906
|
+
void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader
|
|
907
|
+
void SetSaveFileDataCallback(SaveFileDataCallback callback); // Set custom file binary data saver
|
|
908
|
+
void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader
|
|
909
|
+
void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver
|
|
910
|
+
// Files management functions
|
|
911
|
+
unsigned char *LoadFileData(const char *fileName, int *dataSize); // Load file data as byte array (read)
|
|
912
|
+
void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
|
|
913
|
+
bool SaveFileData(const char *fileName, void *data, int dataSize); // Save data to file from byte array (write), returns true on success
|
|
914
|
+
bool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileName); // Export data to code (.h), returns true on success
|
|
915
|
+
char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string
|
|
916
|
+
void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText()
|
|
917
|
+
bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success
|
|
918
|
+
//------------------------------------------------------------------
|
|
919
|
+
// File system functions
|
|
920
|
+
bool FileExists(const char *fileName); // Check if file exists
|
|
921
|
+
bool DirectoryExists(const char *dirPath); // Check if a directory path exists
|
|
922
|
+
bool IsFileExtension(const char *fileName, const char *ext); // Check file extension (including point: .png, .wav)
|
|
923
|
+
int GetFileLength(const char *fileName); // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
|
|
924
|
+
const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes dot: '.png')
|
|
925
|
+
const char *GetFileName(const char *filePath); // Get pointer to filename for a path string
|
|
926
|
+
const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string)
|
|
927
|
+
const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
|
|
928
|
+
const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string)
|
|
929
|
+
const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
|
|
930
|
+
const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string)
|
|
931
|
+
int MakeDirectory(const char *dirPath); // Create directories (including full path requested), returns 0 on success
|
|
932
|
+
bool ChangeDirectory(const char *dir); // Change working directory, return true on success
|
|
933
|
+
bool IsPathFile(const char *path); // Check if a given path is a file or a directory
|
|
934
|
+
bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS
|
|
935
|
+
FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths
|
|
936
|
+
FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result
|
|
937
|
+
void UnloadDirectoryFiles(FilePathList files); // Unload filepaths
|
|
938
|
+
bool IsFileDropped(void); // Check if a file has been dropped into window
|
|
939
|
+
FilePathList LoadDroppedFiles(void); // Load dropped filepaths
|
|
940
|
+
void UnloadDroppedFiles(FilePathList files); // Unload dropped filepaths
|
|
941
|
+
long GetFileModTime(const char *fileName); // Get file modification time (last write time)
|
|
942
|
+
// Compression/Encoding functionality
|
|
943
|
+
unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize); // Compress data (DEFLATE algorithm), memory must be MemFree()
|
|
944
|
+
unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree()
|
|
945
|
+
char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree()
|
|
946
|
+
unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree()
|
|
947
|
+
unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code
|
|
948
|
+
unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes)
|
|
949
|
+
unsigned int *ComputeSHA1(unsigned char *data, int dataSize); // Compute SHA1 hash code, returns static int[5] (20 bytes)
|
|
950
|
+
// Automation events functionality
|
|
951
|
+
AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
|
|
952
|
+
void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file
|
|
953
|
+
bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file
|
|
954
|
+
void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to
|
|
955
|
+
void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording
|
|
956
|
+
void StartAutomationEventRecording(void); // Start recording automation events (AutomationEventList must be set)
|
|
957
|
+
void StopAutomationEventRecording(void); // Stop recording automation events
|
|
958
|
+
void PlayAutomationEvent(AutomationEvent event); // Play a recorded automation event
|
|
959
|
+
//------------------------------------------------------------------------------------
|
|
960
|
+
// Input Handling Functions (Module: core)
|
|
961
|
+
//------------------------------------------------------------------------------------
|
|
962
|
+
// Input-related functions: keyboard
|
|
963
|
+
bool IsKeyPressed(int key); // Check if a key has been pressed once
|
|
964
|
+
bool IsKeyPressedRepeat(int key); // Check if a key has been pressed again
|
|
965
|
+
bool IsKeyDown(int key); // Check if a key is being pressed
|
|
966
|
+
bool IsKeyReleased(int key); // Check if a key has been released once
|
|
967
|
+
bool IsKeyUp(int key); // Check if a key is NOT being pressed
|
|
968
|
+
int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
|
|
969
|
+
int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
|
|
970
|
+
void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
|
|
971
|
+
// Input-related functions: gamepads
|
|
972
|
+
bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
|
|
973
|
+
const char *GetGamepadName(int gamepad); // Get gamepad internal name id
|
|
974
|
+
bool IsGamepadButtonPressed(int gamepad, int button); // Check if a gamepad button has been pressed once
|
|
975
|
+
bool IsGamepadButtonDown(int gamepad, int button); // Check if a gamepad button is being pressed
|
|
976
|
+
bool IsGamepadButtonReleased(int gamepad, int button); // Check if a gamepad button has been released once
|
|
977
|
+
bool IsGamepadButtonUp(int gamepad, int button); // Check if a gamepad button is NOT being pressed
|
|
978
|
+
int GetGamepadButtonPressed(void); // Get the last gamepad button pressed
|
|
979
|
+
int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad
|
|
980
|
+
float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis
|
|
981
|
+
int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB)
|
|
982
|
+
void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds)
|
|
983
|
+
// Input-related functions: mouse
|
|
984
|
+
bool IsMouseButtonPressed(int button); // Check if a mouse button has been pressed once
|
|
985
|
+
bool IsMouseButtonDown(int button); // Check if a mouse button is being pressed
|
|
986
|
+
bool IsMouseButtonReleased(int button); // Check if a mouse button has been released once
|
|
987
|
+
bool IsMouseButtonUp(int button); // Check if a mouse button is NOT being pressed
|
|
988
|
+
int GetMouseX(void); // Get mouse position X
|
|
989
|
+
int GetMouseY(void); // Get mouse position Y
|
|
990
|
+
Vector2 GetMousePosition(void); // Get mouse position XY
|
|
991
|
+
Vector2 GetMouseDelta(void); // Get mouse delta between frames
|
|
992
|
+
void SetMousePosition(int x, int y); // Set mouse position XY
|
|
993
|
+
void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset
|
|
994
|
+
void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling
|
|
995
|
+
float GetMouseWheelMove(void); // Get mouse wheel movement for X or Y, whichever is larger
|
|
996
|
+
Vector2 GetMouseWheelMoveV(void); // Get mouse wheel movement for both X and Y
|
|
997
|
+
void SetMouseCursor(int cursor); // Set mouse cursor
|
|
998
|
+
// Input-related functions: touch
|
|
999
|
+
int GetTouchX(void); // Get touch position X for touch point 0 (relative to screen size)
|
|
1000
|
+
int GetTouchY(void); // Get touch position Y for touch point 0 (relative to screen size)
|
|
1001
|
+
Vector2 GetTouchPosition(int index); // Get touch position XY for a touch point index (relative to screen size)
|
|
1002
|
+
int GetTouchPointId(int index); // Get touch point identifier for given index
|
|
1003
|
+
int GetTouchPointCount(void); // Get number of touch points
|
|
1004
|
+
//------------------------------------------------------------------------------------
|
|
1005
|
+
// Gestures and Touch Handling Functions (Module: rgestures)
|
|
1006
|
+
//------------------------------------------------------------------------------------
|
|
1007
|
+
void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
|
|
1008
|
+
bool IsGestureDetected(unsigned int gesture); // Check if a gesture have been detected
|
|
1009
|
+
int GetGestureDetected(void); // Get latest detected gesture
|
|
1010
|
+
float GetGestureHoldDuration(void); // Get gesture hold time in seconds
|
|
1011
|
+
Vector2 GetGestureDragVector(void); // Get gesture drag vector
|
|
1012
|
+
float GetGestureDragAngle(void); // Get gesture drag angle
|
|
1013
|
+
Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
|
|
1014
|
+
float GetGesturePinchAngle(void); // Get gesture pinch angle
|
|
1015
|
+
//------------------------------------------------------------------------------------
|
|
1016
|
+
// Camera System Functions (Module: rcamera)
|
|
1017
|
+
//------------------------------------------------------------------------------------
|
|
1018
|
+
void UpdateCamera(Camera *camera, int mode); // Update camera position for selected mode
|
|
1019
|
+
void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, float zoom); // Update camera movement/rotation
|
|
1020
|
+
//------------------------------------------------------------------------------------
|
|
1021
|
+
// Basic Shapes Drawing Functions (Module: shapes)
|
|
1022
|
+
//------------------------------------------------------------------------------------
|
|
1023
|
+
// Set texture and rectangle to be used on shapes drawing
|
|
1024
|
+
// NOTE: It can be useful when using basic shapes and one single font,
|
|
1025
|
+
// defining a font char white rectangle would allow drawing everything in a single draw call
|
|
1026
|
+
void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing
|
|
1027
|
+
Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing
|
|
1028
|
+
Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing
|
|
1029
|
+
// Basic shapes drawing functions
|
|
1030
|
+
void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care]
|
|
1031
|
+
void DrawPixelV(Vector2 position, Color color); // Draw a pixel using geometry (Vector version) [Can be slow, use with care]
|
|
1032
|
+
void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line
|
|
1033
|
+
void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (using gl lines)
|
|
1034
|
+
void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line (using triangles/quads)
|
|
1035
|
+
void DrawLineStrip(const Vector2 *points, int pointCount, Color color); // Draw lines sequence (using gl lines)
|
|
1036
|
+
void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw line segment cubic-bezier in-out interpolation
|
|
1037
|
+
void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle
|
|
1038
|
+
void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw a piece of a circle
|
|
1039
|
+
void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); // Draw circle sector outline
|
|
1040
|
+
void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer); // Draw a gradient-filled circle
|
|
1041
|
+
void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version)
|
|
1042
|
+
void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
|
|
1043
|
+
void DrawCircleLinesV(Vector2 center, float radius, Color color); // Draw circle outline (Vector version)
|
|
1044
|
+
void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse
|
|
1045
|
+
void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline
|
|
1046
|
+
void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring
|
|
1047
|
+
void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline
|
|
1048
|
+
void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
|
|
1049
|
+
void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
|
|
1050
|
+
void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
|
|
1051
|
+
void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
|
|
1052
|
+
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle
|
|
1053
|
+
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle
|
|
1054
|
+
void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors
|
|
1055
|
+
void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
|
|
1056
|
+
void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters
|
|
1057
|
+
void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges
|
|
1058
|
+
void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges
|
|
1059
|
+
void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline
|
|
1060
|
+
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
|
1061
|
+
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!)
|
|
1062
|
+
void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center)
|
|
1063
|
+
void DrawTriangleStrip(const Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points
|
|
1064
|
+
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version)
|
|
1065
|
+
void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides
|
|
1066
|
+
void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); // Draw a polygon outline of n sides with extended parameters
|
|
1067
|
+
// Splines drawing functions
|
|
1068
|
+
void DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Linear, minimum 2 points
|
|
1069
|
+
void DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: B-Spline, minimum 4 points
|
|
1070
|
+
void DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Catmull-Rom, minimum 4 points
|
|
1071
|
+
void DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
|
|
1072
|
+
void DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color); // Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
|
|
1073
|
+
void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color); // Draw spline segment: Linear, 2 points
|
|
1074
|
+
void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: B-Spline, 4 points
|
|
1075
|
+
void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color); // Draw spline segment: Catmull-Rom, 4 points
|
|
1076
|
+
void DrawSplineSegmentBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color); // Draw spline segment: Quadratic Bezier, 2 points, 1 control point
|
|
1077
|
+
void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color); // Draw spline segment: Cubic Bezier, 2 points, 2 control points
|
|
1078
|
+
// Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]
|
|
1079
|
+
Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t); // Get (evaluate) spline point: Linear
|
|
1080
|
+
Vector2 GetSplinePointBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: B-Spline
|
|
1081
|
+
Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t); // Get (evaluate) spline point: Catmull-Rom
|
|
1082
|
+
Vector2 GetSplinePointBezierQuad(Vector2 p1, Vector2 c2, Vector2 p3, float t); // Get (evaluate) spline point: Quadratic Bezier
|
|
1083
|
+
Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t); // Get (evaluate) spline point: Cubic Bezier
|
|
1084
|
+
// Basic shapes collision detection functions
|
|
1085
|
+
bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles
|
|
1086
|
+
bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles
|
|
1087
|
+
bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle
|
|
1088
|
+
bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2]
|
|
1089
|
+
bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle
|
|
1090
|
+
bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle
|
|
1091
|
+
bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle
|
|
1092
|
+
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]
|
|
1093
|
+
bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices
|
|
1094
|
+
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
|
|
1095
|
+
Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision
|
|
1096
|
+
//------------------------------------------------------------------------------------
|
|
1097
|
+
// Texture Loading and Drawing Functions (Module: textures)
|
|
1098
|
+
//------------------------------------------------------------------------------------
|
|
1099
|
+
// Image loading functions
|
|
1100
|
+
// NOTE: These functions do not require GPU access
|
|
1101
|
+
Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM)
|
|
1102
|
+
Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
|
|
1103
|
+
Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data)
|
|
1104
|
+
Image LoadImageAnimFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int *frames); // Load image sequence from memory buffer
|
|
1105
|
+
Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png'
|
|
1106
|
+
Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data
|
|
1107
|
+
Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot)
|
|
1108
|
+
bool IsImageValid(Image image); // Check if an image is valid (data and parameters)
|
|
1109
|
+
void UnloadImage(Image image); // Unload image from CPU memory (RAM)
|
|
1110
|
+
bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success
|
|
1111
|
+
unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer
|
|
1112
|
+
bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success
|
|
1113
|
+
// Image generation functions
|
|
1114
|
+
Image GenImageColor(int width, int height, Color color); // Generate image: plain color
|
|
1115
|
+
Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient
|
|
1116
|
+
Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
|
|
1117
|
+
Image GenImageGradientSquare(int width, int height, float density, Color inner, Color outer); // Generate image: square gradient
|
|
1118
|
+
Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
|
|
1119
|
+
Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise
|
|
1120
|
+
Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise
|
|
1121
|
+
Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells
|
|
1122
|
+
Image GenImageText(int width, int height, const char *text); // Generate image: grayscale image from text data
|
|
1123
|
+
// Image manipulation functions
|
|
1124
|
+
Image ImageCopy(Image image); // Create an image duplicate (useful for transformations)
|
|
1125
|
+
Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece
|
|
1126
|
+
Image ImageFromChannel(Image image, int selectedChannel); // Create an image from a selected channel of another image (GRAYSCALE)
|
|
1127
|
+
Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
|
|
1128
|
+
Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
|
|
1129
|
+
void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
|
|
1130
|
+
void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two)
|
|
1131
|
+
void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
|
|
1132
|
+
void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
|
|
1133
|
+
void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
|
|
1134
|
+
void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
|
1135
|
+
void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
|
1136
|
+
void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation
|
|
1137
|
+
void ImageKernelConvolution(Image *image, const float *kernel, int kernelSize); // Apply custom square convolution kernel to image
|
|
1138
|
+
void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
|
|
1139
|
+
void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
|
1140
|
+
void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
|
|
1141
|
+
void ImageMipmaps(Image *image); // Compute all mipmap levels for a provided image
|
|
1142
|
+
void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
|
1143
|
+
void ImageFlipVertical(Image *image); // Flip image vertically
|
|
1144
|
+
void ImageFlipHorizontal(Image *image); // Flip image horizontally
|
|
1145
|
+
void ImageRotate(Image *image, int degrees); // Rotate image by input angle in degrees (-359 to 359)
|
|
1146
|
+
void ImageRotateCW(Image *image); // Rotate image clockwise 90deg
|
|
1147
|
+
void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg
|
|
1148
|
+
void ImageColorTint(Image *image, Color color); // Modify image color: tint
|
|
1149
|
+
void ImageColorInvert(Image *image); // Modify image color: invert
|
|
1150
|
+
void ImageColorGrayscale(Image *image); // Modify image color: grayscale
|
|
1151
|
+
void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
|
|
1152
|
+
void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
|
|
1153
|
+
void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
|
|
1154
|
+
Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit)
|
|
1155
|
+
Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit)
|
|
1156
|
+
void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors()
|
|
1157
|
+
void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette()
|
|
1158
|
+
Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle
|
|
1159
|
+
Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position
|
|
1160
|
+
// Image drawing functions
|
|
1161
|
+
// NOTE: Image software-rendering functions (CPU)
|
|
1162
|
+
void ImageClearBackground(Image *dst, Color color); // Clear image background with given color
|
|
1163
|
+
void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image
|
|
1164
|
+
void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version)
|
|
1165
|
+
void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image
|
|
1166
|
+
void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version)
|
|
1167
|
+
void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int thick, Color color); // Draw a line defining thickness within an image
|
|
1168
|
+
void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image
|
|
1169
|
+
void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version)
|
|
1170
|
+
void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image
|
|
1171
|
+
void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version)
|
|
1172
|
+
void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image
|
|
1173
|
+
void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version)
|
|
1174
|
+
void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image
|
|
1175
|
+
void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image
|
|
1176
|
+
void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image
|
|
1177
|
+
void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image
|
|
1178
|
+
void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image
|
|
1179
|
+
void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center)
|
|
1180
|
+
void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image
|
|
1181
|
+
void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source)
|
|
1182
|
+
void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination)
|
|
1183
|
+
void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination)
|
|
1184
|
+
// Texture loading functions
|
|
1185
|
+
// NOTE: These functions require GPU access
|
|
1186
|
+
Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM)
|
|
1187
|
+
Texture2D LoadTextureFromImage(Image image); // Load texture from image data
|
|
1188
|
+
TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported
|
|
1189
|
+
RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer)
|
|
1190
|
+
bool IsTextureValid(Texture2D texture); // Check if a texture is valid (loaded in GPU)
|
|
1191
|
+
void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
|
|
1192
|
+
bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU)
|
|
1193
|
+
void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
|
|
1194
|
+
void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
|
|
1195
|
+
void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data
|
|
1196
|
+
// Texture configuration functions
|
|
1197
|
+
void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture
|
|
1198
|
+
void SetTextureFilter(Texture2D texture, int filter); // Set texture scaling filter mode
|
|
1199
|
+
void SetTextureWrap(Texture2D texture, int wrap); // Set texture wrapping mode
|
|
1200
|
+
// Texture drawing functions
|
|
1201
|
+
void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D
|
|
1202
|
+
void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2
|
|
1203
|
+
void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
|
|
1204
|
+
void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
|
|
1205
|
+
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
|
|
1206
|
+
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
|
|
1207
|
+
// Color/pixel related functions
|
|
1208
|
+
bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal
|
|
1209
|
+
Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
|
|
1210
|
+
int ColorToInt(Color color); // Get hexadecimal value for a Color (0xRRGGBBAA)
|
|
1211
|
+
Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1]
|
|
1212
|
+
Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1]
|
|
1213
|
+
Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1]
|
|
1214
|
+
Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1]
|
|
1215
|
+
Color ColorTint(Color color, Color tint); // Get color multiplied with another color
|
|
1216
|
+
Color ColorBrightness(Color color, float factor); // Get color with brightness correction, brightness factor goes from -1.0f to 1.0f
|
|
1217
|
+
Color ColorContrast(Color color, float contrast); // Get color with contrast correction, contrast values between -1.0f and 1.0f
|
|
1218
|
+
Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
|
|
1219
|
+
Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint
|
|
1220
|
+
Color ColorLerp(Color color1, Color color2, float factor); // Get color lerp interpolation between two colors, factor [0.0f..1.0f]
|
|
1221
|
+
Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value
|
|
1222
|
+
Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format
|
|
1223
|
+
void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer
|
|
1224
|
+
int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format
|
|
1225
|
+
//------------------------------------------------------------------------------------
|
|
1226
|
+
// Font Loading and Text Drawing Functions (Module: text)
|
|
1227
|
+
//------------------------------------------------------------------------------------
|
|
1228
|
+
// Font loading/unloading functions
|
|
1229
|
+
Font GetFontDefault(void); // Get the default Font
|
|
1230
|
+
Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
|
|
1231
|
+
Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepointCount); // Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height
|
|
1232
|
+
Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
|
|
1233
|
+
Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
|
|
1234
|
+
bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked)
|
|
1235
|
+
GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use
|
|
1236
|
+
Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
|
|
1237
|
+
void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM)
|
|
1238
|
+
void UnloadFont(Font font); // Unload font from GPU memory (VRAM)
|
|
1239
|
+
bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success
|
|
1240
|
+
// Text drawing functions
|
|
1241
|
+
void DrawFPS(int posX, int posY); // Draw current FPS
|
|
1242
|
+
void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font)
|
|
1243
|
+
void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
|
|
1244
|
+
void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation)
|
|
1245
|
+
void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
|
|
1246
|
+
void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint)
|
|
1247
|
+
// Text font info functions
|
|
1248
|
+
void SetTextLineSpacing(int spacing); // Set vertical line spacing when drawing with line-breaks
|
|
1249
|
+
int MeasureText(const char *text, int fontSize); // Measure string width for default font
|
|
1250
|
+
Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font
|
|
1251
|
+
int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
|
|
1252
|
+
GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found
|
|
1253
|
+
Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
|
|
1254
|
+
// Text codepoints management functions (unicode characters)
|
|
1255
|
+
char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array
|
|
1256
|
+
void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array
|
|
1257
|
+
int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
|
|
1258
|
+
void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory
|
|
1259
|
+
int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string
|
|
1260
|
+
int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
|
1261
|
+
int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
|
1262
|
+
int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
|
|
1263
|
+
const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
|
|
1264
|
+
// Text strings management functions (no UTF-8 strings, only byte chars)
|
|
1265
|
+
// NOTE: Some strings allocate memory internally for returned strings, just be careful!
|
|
1266
|
+
int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied
|
|
1267
|
+
bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal
|
|
1268
|
+
unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending
|
|
1269
|
+
const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf() style)
|
|
1270
|
+
const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string
|
|
1271
|
+
char *TextReplace(const char *text, const char *replace, const char *by); // Replace text string (WARNING: memory must be freed!)
|
|
1272
|
+
char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (WARNING: memory must be freed!)
|
|
1273
|
+
const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter
|
|
1274
|
+
const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings
|
|
1275
|
+
void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor!
|
|
1276
|
+
int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string
|
|
1277
|
+
const char *TextToUpper(const char *text); // Get upper case version of provided string
|
|
1278
|
+
const char *TextToLower(const char *text); // Get lower case version of provided string
|
|
1279
|
+
const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string
|
|
1280
|
+
const char *TextToSnake(const char *text); // Get Snake case notation version of provided string
|
|
1281
|
+
const char *TextToCamel(const char *text); // Get Camel case notation version of provided string
|
|
1282
|
+
int TextToInteger(const char *text); // Get integer value from text (negative values not supported)
|
|
1283
|
+
float TextToFloat(const char *text); // Get float value from text (negative values not supported)
|
|
1284
|
+
//------------------------------------------------------------------------------------
|
|
1285
|
+
// Basic 3d Shapes Drawing Functions (Module: models)
|
|
1286
|
+
//------------------------------------------------------------------------------------
|
|
1287
|
+
// Basic geometric 3D shapes drawing functions
|
|
1288
|
+
void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space
|
|
1289
|
+
void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line
|
|
1290
|
+
void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space
|
|
1291
|
+
void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
|
1292
|
+
void DrawTriangleStrip3D(const Vector3 *points, int pointCount, Color color); // Draw a triangle strip defined by points
|
|
1293
|
+
void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube
|
|
1294
|
+
void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
|
|
1295
|
+
void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
|
|
1296
|
+
void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version)
|
|
1297
|
+
void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere
|
|
1298
|
+
void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters
|
|
1299
|
+
void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires
|
|
1300
|
+
void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone
|
|
1301
|
+
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
|
|
1302
|
+
void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires
|
|
1303
|
+
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
|
|
1304
|
+
void DrawCapsule(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw a capsule with the center of its sphere caps at startPos and endPos
|
|
1305
|
+
void DrawCapsuleWires(Vector3 startPos, Vector3 endPos, float radius, int slices, int rings, Color color); // Draw capsule wireframe with the center of its sphere caps at startPos and endPos
|
|
1306
|
+
void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
|
|
1307
|
+
void DrawRay(Ray ray, Color color); // Draw a ray line
|
|
1308
|
+
void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
|
|
1309
|
+
//------------------------------------------------------------------------------------
|
|
1310
|
+
// Model 3d Loading and Drawing Functions (Module: models)
|
|
1311
|
+
//------------------------------------------------------------------------------------
|
|
1312
|
+
// Model management functions
|
|
1313
|
+
Model LoadModel(const char *fileName); // Load model from files (meshes and materials)
|
|
1314
|
+
Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material)
|
|
1315
|
+
bool IsModelValid(Model model); // Check if a model is valid (loaded in GPU, VAO/VBOs)
|
|
1316
|
+
void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM)
|
|
1317
|
+
BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes)
|
|
1318
|
+
// Model drawing functions
|
|
1319
|
+
void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
|
|
1320
|
+
void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
|
|
1321
|
+
void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
|
|
1322
|
+
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
|
|
1323
|
+
void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); // Draw a model as points
|
|
1324
|
+
void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters
|
|
1325
|
+
void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
|
|
1326
|
+
void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture
|
|
1327
|
+
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source
|
|
1328
|
+
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
|
|
1329
|
+
// Mesh management functions
|
|
1330
|
+
void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids
|
|
1331
|
+
void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index
|
|
1332
|
+
void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU
|
|
1333
|
+
void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform
|
|
1334
|
+
void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms
|
|
1335
|
+
BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
|
|
1336
|
+
void GenMeshTangents(Mesh *mesh); // Compute mesh tangents
|
|
1337
|
+
bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success
|
|
1338
|
+
bool ExportMeshAsCode(Mesh mesh, const char *fileName); // Export mesh as code file (.h) defining multiple arrays of vertex attributes
|
|
1339
|
+
// Mesh generation functions
|
|
1340
|
+
Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh
|
|
1341
|
+
Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions)
|
|
1342
|
+
Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh
|
|
1343
|
+
Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere)
|
|
1344
|
+
Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap)
|
|
1345
|
+
Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh
|
|
1346
|
+
Mesh GenMeshCone(float radius, float height, int slices); // Generate cone/pyramid mesh
|
|
1347
|
+
Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh
|
|
1348
|
+
Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh
|
|
1349
|
+
Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data
|
|
1350
|
+
Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data
|
|
1351
|
+
// Material loading/unloading functions
|
|
1352
|
+
Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file
|
|
1353
|
+
Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
|
|
1354
|
+
bool IsMaterialValid(Material material); // Check if a material is valid (shader assigned, map textures loaded in GPU)
|
|
1355
|
+
void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM)
|
|
1356
|
+
void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)
|
|
1357
|
+
void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh
|
|
1358
|
+
// Model animations loading/unloading functions
|
|
1359
|
+
ModelAnimation *LoadModelAnimations(const char *fileName, int *animCount); // Load model animations from file
|
|
1360
|
+
void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose (CPU)
|
|
1361
|
+
void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame); // Update model animation mesh bone matrices (GPU skinning)
|
|
1362
|
+
void UnloadModelAnimation(ModelAnimation anim); // Unload animation data
|
|
1363
|
+
void UnloadModelAnimations(ModelAnimation *animations, int animCount); // Unload animation array data
|
|
1364
|
+
bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match
|
|
1365
|
+
// Collision detection functions
|
|
1366
|
+
bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres
|
|
1367
|
+
bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Check collision between two bounding boxes
|
|
1368
|
+
bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere
|
|
1369
|
+
RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere
|
|
1370
|
+
RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box
|
|
1371
|
+
RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh
|
|
1372
|
+
RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
|
|
1373
|
+
RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad
|
|
1374
|
+
//------------------------------------------------------------------------------------
|
|
1375
|
+
// Audio Loading and Playing Functions (Module: audio)
|
|
1376
|
+
//------------------------------------------------------------------------------------
|
|
1377
|
+
typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
|
|
1378
|
+
// Audio device management functions
|
|
1379
|
+
void InitAudioDevice(void); // Initialize audio device and context
|
|
1380
|
+
void CloseAudioDevice(void); // Close the audio device and context
|
|
1381
|
+
bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully
|
|
1382
|
+
void SetMasterVolume(float volume); // Set master volume (listener)
|
|
1383
|
+
float GetMasterVolume(void); // Get master volume (listener)
|
|
1384
|
+
// Wave/Sound loading/unloading functions
|
|
1385
|
+
Wave LoadWave(const char *fileName); // Load wave data from file
|
|
1386
|
+
Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
|
|
1387
|
+
bool IsWaveValid(Wave wave); // Checks if wave data is valid (data loaded and parameters)
|
|
1388
|
+
Sound LoadSound(const char *fileName); // Load sound from file
|
|
1389
|
+
Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
|
|
1390
|
+
Sound LoadSoundAlias(Sound source); // Create a new sound that shares the same sample data as the source sound, does not own the sound data
|
|
1391
|
+
bool IsSoundValid(Sound sound); // Checks if a sound is valid (data loaded and buffers initialized)
|
|
1392
|
+
void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data
|
|
1393
|
+
void UnloadWave(Wave wave); // Unload wave data
|
|
1394
|
+
void UnloadSound(Sound sound); // Unload sound
|
|
1395
|
+
void UnloadSoundAlias(Sound alias); // Unload a sound alias (does not deallocate sample data)
|
|
1396
|
+
bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success
|
|
1397
|
+
bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success
|
|
1398
|
+
// Wave/Sound management functions
|
|
1399
|
+
void PlaySound(Sound sound); // Play a sound
|
|
1400
|
+
void StopSound(Sound sound); // Stop playing a sound
|
|
1401
|
+
void PauseSound(Sound sound); // Pause a sound
|
|
1402
|
+
void ResumeSound(Sound sound); // Resume a paused sound
|
|
1403
|
+
bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
|
|
1404
|
+
void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
|
|
1405
|
+
void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
|
|
1406
|
+
void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center)
|
|
1407
|
+
Wave WaveCopy(Wave wave); // Copy a wave to a new wave
|
|
1408
|
+
void WaveCrop(Wave *wave, int initFrame, int finalFrame); // Crop a wave to defined frames range
|
|
1409
|
+
void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format
|
|
1410
|
+
float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array
|
|
1411
|
+
void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples()
|
|
1412
|
+
// Music management functions
|
|
1413
|
+
Music LoadMusicStream(const char *fileName); // Load music stream from file
|
|
1414
|
+
Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data
|
|
1415
|
+
bool IsMusicValid(Music music); // Checks if a music stream is valid (context and buffers initialized)
|
|
1416
|
+
void UnloadMusicStream(Music music); // Unload music stream
|
|
1417
|
+
void PlayMusicStream(Music music); // Start music playing
|
|
1418
|
+
bool IsMusicStreamPlaying(Music music); // Check if music is playing
|
|
1419
|
+
void UpdateMusicStream(Music music); // Updates buffers for music streaming
|
|
1420
|
+
void StopMusicStream(Music music); // Stop music playing
|
|
1421
|
+
void PauseMusicStream(Music music); // Pause music playing
|
|
1422
|
+
void ResumeMusicStream(Music music); // Resume playing paused music
|
|
1423
|
+
void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds)
|
|
1424
|
+
void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
|
|
1425
|
+
void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
|
1426
|
+
void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center)
|
|
1427
|
+
float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
|
1428
|
+
float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
|
1429
|
+
// AudioStream management functions
|
|
1430
|
+
AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data)
|
|
1431
|
+
bool IsAudioStreamValid(AudioStream stream); // Checks if an audio stream is valid (buffers initialized)
|
|
1432
|
+
void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory
|
|
1433
|
+
void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data
|
|
1434
|
+
bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
|
|
1435
|
+
void PlayAudioStream(AudioStream stream); // Play audio stream
|
|
1436
|
+
void PauseAudioStream(AudioStream stream); // Pause audio stream
|
|
1437
|
+
void ResumeAudioStream(AudioStream stream); // Resume audio stream
|
|
1438
|
+
bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing
|
|
1439
|
+
void StopAudioStream(AudioStream stream); // Stop audio stream
|
|
1440
|
+
void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
|
|
1441
|
+
void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
|
|
1442
|
+
void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered)
|
|
1443
|
+
void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
|
|
1444
|
+
void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data
|
|
1445
|
+
void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream, receives the samples as 'float'
|
|
1446
|
+
void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream
|
|
1447
|
+
void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'
|
|
1448
|
+
void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline
|