summaryrefslogtreecommitdiffhomepage
path: root/cheatsheet
diff options
context:
space:
mode:
Diffstat (limited to 'cheatsheet')
-rw-r--r--cheatsheet/cheatsheet.html2
-rw-r--r--cheatsheet/raylib_audio.c10
-rw-r--r--cheatsheet/raylib_core.c21
-rw-r--r--cheatsheet/raylib_math.c121
-rw-r--r--cheatsheet/raylib_models.c13
-rw-r--r--cheatsheet/raylib_shapes.c1
-rw-r--r--cheatsheet/raylib_text.c16
-rw-r--r--cheatsheet/raylib_textures.c24
8 files changed, 51 insertions, 157 deletions
diff --git a/cheatsheet/cheatsheet.html b/cheatsheet/cheatsheet.html
index 278cf9a..94f1809 100644
--- a/cheatsheet/cheatsheet.html
+++ b/cheatsheet/cheatsheet.html
@@ -130,7 +130,7 @@
<p id="title">A simple and easy-to-use library to enjoy videogames programming</p>
<p id="plinks">[<a href="https://discord.gg/raylib">raylib Discord server</a>][<a href="https://github.com/raysan5/raylib">github.com/raysan5/raylib</a>][<a href="https://github.com/raysan5/raylib/blob/master/src/raylib.h">raylib.h</a>]</p>
<p></p>
- <p id="version">v4.2 quick reference card [<a id="downpdf" href="https://www.raylib.com/cheatsheet/raylib_cheatsheet_v4.2.pdf">download as PDF</a>]</p>
+ <p id="version">v4.5 quick reference card [<a id="downpdf" href="https://www.raylib.com/cheatsheet/raylib_cheatsheet_v4.5.pdf">download as PDF</a>]</p>
</div>
<br>
<p>Chinese Translation: <a href="cheatsheet_zh.html">以下为raylib所有API接口中文释义</a></p>
diff --git a/cheatsheet/raylib_audio.c b/cheatsheet/raylib_audio.c
index c0381ed..1cbb545 100644
--- a/cheatsheet/raylib_audio.c
+++ b/cheatsheet/raylib_audio.c
@@ -7,8 +7,10 @@
// Wave/Sound loading/unloading functions
Wave LoadWave(const char *fileName); // Load wave data from file
Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
+ bool IsWaveReady(Wave wave); // Checks if wave data is ready
Sound LoadSound(const char *fileName); // Load sound from file
Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
+ bool IsSoundReady(Sound sound); // Checks if a sound is ready
void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data
void UnloadWave(Wave wave); // Unload wave data
void UnloadSound(Sound sound); // Unload sound
@@ -20,9 +22,6 @@
void StopSound(Sound sound); // Stop playing a sound
void PauseSound(Sound sound); // Pause a sound
void ResumeSound(Sound sound); // Resume a paused sound
- void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool)
- void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool)
- int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel
bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing
void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level)
void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
@@ -36,6 +35,7 @@
// Music management functions
Music LoadMusicStream(const char *fileName); // Load music stream from file
Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data
+ bool IsMusicReady(Music music); // Checks if a music stream is ready
void UnloadMusicStream(Music music); // Unload music stream
void PlayMusicStream(Music music); // Start music playing
bool IsMusicStreamPlaying(Music music); // Check if music is playing
@@ -52,6 +52,7 @@
// AudioStream management functions
AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data)
+ bool IsAudioStreamReady(AudioStream stream); // Checks if an audio stream is ready
void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory
void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data
bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
@@ -69,3 +70,6 @@
void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Attach audio stream processor to stream
void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); // Detach audio stream processor from stream
+ void AttachAudioMixedProcessor(AudioCallback processor); // Attach audio stream processor to the entire audio pipeline
+ void DetachAudioMixedProcessor(AudioCallback processor); // Detach audio stream processor from the entire audio pipeline
+
diff --git a/cheatsheet/raylib_core.c b/cheatsheet/raylib_core.c
index 1a227ca..a93ae63 100644
--- a/cheatsheet/raylib_core.c
+++ b/cheatsheet/raylib_core.c
@@ -17,7 +17,8 @@
void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
- void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP)
+ void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)
+ void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP)
void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
@@ -47,7 +48,7 @@
// Custom frame control functions
// NOTE: Those functions are intended for advance users that want full control over the frame processing
- // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
+ // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
// To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL
void SwapScreenBuffer(void); // Swap back buffer with front buffer (screen drawing)
void PollInputEvents(void); // Register all input events
@@ -88,6 +89,7 @@
// NOTE: Shader functionality is not available on OpenGL 1.1
Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations
Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations
+ bool IsShaderReady(Shader shader); // Check if a shader is ready
int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location
void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value
@@ -119,8 +121,8 @@
void TraceLog(int logLevel, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
void SetTraceLogLevel(int logLevel); // Set the current threshold (minimum) log level
- void *MemAlloc(int size); // Internal memory allocator
- void *MemRealloc(void *ptr, int size); // Internal memory reallocator
+ void *MemAlloc(unsigned int size); // Internal memory allocator
+ void *MemRealloc(void *ptr, unsigned int size); // Internal memory reallocator
void MemFree(void *ptr); // Internal memory free
void OpenURL(const char *url); // Open URL with default system browser (if available)
@@ -137,7 +139,7 @@
unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read)
void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success
- bool ExportDataAsCode(const char *data, unsigned int size, const char *fileName); // Export data to code (.h), returns true on success
+ bool ExportDataAsCode(const unsigned char *data, unsigned int size, const char *fileName); // Export data to code (.h), returns true on success
char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string
void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText()
bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success
@@ -231,11 +233,6 @@
//------------------------------------------------------------------------------------
// Camera System Functions (Module: rcamera)
//------------------------------------------------------------------------------------
- void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available)
- void UpdateCamera(Camera *camera); // Update camera position for selected mode
-
- void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera)
- void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera)
- void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera)
- void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras)
+ void UpdateCamera(Camera *camera, int mode); // Update camera position for selected mode
+ void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, float zoom); // Update camera movement/rotation
diff --git a/cheatsheet/raylib_math.c b/cheatsheet/raylib_math.c
index 3b916f3..e69de29 100644
--- a/cheatsheet/raylib_math.c
+++ b/cheatsheet/raylib_math.c
@@ -1,121 +0,0 @@
-
- // Utils math
- float Clamp(float value, float min, float max) // Function specifiers definition Defines and Macros Get float vector for Matrix Get float vector for Vector3 Types and Structures Definition Vector2 type Vector3 type Vector4 type Quaternion type Matrix type (OpenGL style 4x4 - right handed, column major) NOTE: Helper types to be used instead of array return types for *ToFloat functions Clamp float value
- float Lerp(float start, float end, float amount) // Calculate linear interpolation between two floats
- float Normalize(float value, float start, float end) // Normalize input value within input range
- float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd) // Remap input value within input range to output range
- float Wrap(float value, float min, float max) // Wrap input value from min to max
- int FloatEquals(float x, float y) // Check whether two given floats are almost equal
-
- // Vector2 math
- Vector2 Vector2Zero(void) // Vector with components value 0.0f
- Vector2 Vector2One(void) // Vector with components value 1.0f
- Vector2 Vector2Add(Vector2 v1, Vector2 v2) // Add two vectors (v1 + v2)
- Vector2 Vector2AddValue(Vector2 v, float add) // Add vector and float value
- Vector2 Vector2Subtract(Vector2 v1, Vector2 v2) // Subtract two vectors (v1 - v2)
- Vector2 Vector2SubtractValue(Vector2 v, float sub) // Subtract vector by float value
- float Vector2Length(Vector2 v) // Calculate vector length
- float Vector2LengthSqr(Vector2 v) // Calculate vector square length
- float Vector2DotProduct(Vector2 v1, Vector2 v2) // Calculate two vectors dot product
- float Vector2Distance(Vector2 v1, Vector2 v2) // Calculate distance between two vectors
- float Vector2DistanceSqr(Vector2 v1, Vector2 v2) // Calculate square distance between two vectors
- float Vector2Angle(Vector2 v1, Vector2 v2) // Calculate angle from two vectors
- Vector2 Vector2Scale(Vector2 v, float scale) // Scale vector (multiply by value)
- Vector2 Vector2Multiply(Vector2 v1, Vector2 v2) // Multiply vector by vector
- Vector2 Vector2Negate(Vector2 v) // Negate vector
- Vector2 Vector2Divide(Vector2 v1, Vector2 v2) // Divide vector by vector
- Vector2 Vector2Normalize(Vector2 v) // Normalize provided vector
- Vector2 Vector2Transform(Vector2 v, Matrix mat) // Transforms a Vector2 by a given Matrix
- Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount) // Calculate linear interpolation between two vectors
- Vector2 Vector2Reflect(Vector2 v, Vector2 normal) // Calculate reflected vector to normal
- Vector2 Vector2Rotate(Vector2 v, float angle) // Rotate vector by angle
- Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance) // Move Vector towards target
- Vector2 Vector2Invert(Vector2 v) // Invert the given vector
- Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max) // Clamp the components of the vector between min and max values specified by the given vectors
- Vector2 Vector2ClampValue(Vector2 v, float min, float max) // Clamp the magnitude of the vector between two min and max values
- int Vector2Equals(Vector2 p, Vector2 q) // Check whether two given vectors are almost equal
-
- // Vector3 math
- Vector3 Vector3Zero(void) // Vector with components value 0.0f
- Vector3 Vector3One(void) // Vector with components value 1.0f
- Vector3 Vector3Add(Vector3 v1, Vector3 v2) // Add two vectors
- Vector3 Vector3AddValue(Vector3 v, float add) // Add vector and float value
- Vector3 Vector3Subtract(Vector3 v1, Vector3 v2) // Subtract two vectors
- Vector3 Vector3SubtractValue(Vector3 v, float sub) // Subtract vector by float value
- Vector3 Vector3Scale(Vector3 v, float scalar) // Multiply vector by scalar
- Vector3 Vector3Multiply(Vector3 v1, Vector3 v2) // Multiply vector by vector
- Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2) // Calculate two vectors cross product
- Vector3 Vector3Perpendicular(Vector3 v) // Calculate one vector perpendicular vector
- float Vector3Length(const Vector3 v) // Calculate vector length
- float Vector3LengthSqr(const Vector3 v) // Calculate vector square length
- float Vector3DotProduct(Vector3 v1, Vector3 v2) // Calculate two vectors dot product
- float Vector3Distance(Vector3 v1, Vector3 v2) // Calculate distance between two vectors
- float Vector3DistanceSqr(Vector3 v1, Vector3 v2) // Calculate square distance between two vectors
- float Vector3Angle(Vector3 v1, Vector3 v2) // Calculate angle between two vectors
- Vector3 Vector3Negate(Vector3 v) // Negate provided vector (invert direction)
- Vector3 Vector3Divide(Vector3 v1, Vector3 v2) // Divide vector by vector
- Vector3 Vector3Normalize(Vector3 v) // Normalize provided vector
- void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2) // Orthonormalize provided vectors Makes vectors normalized and orthogonal to each other Gram-Schmidt function implementation
- Vector3 Vector3Transform(Vector3 v, Matrix mat) // Transforms a Vector3 by a given Matrix
- Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q) // Transform a vector by quaternion rotation
- Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle) // Rotates a vector around an axis
- Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount) // Calculate linear interpolation between two vectors
- Vector3 Vector3Reflect(Vector3 v, Vector3 normal) // Calculate reflected vector to normal
- Vector3 Vector3Min(Vector3 v1, Vector3 v2) // Get min value for each pair of components
- Vector3 Vector3Max(Vector3 v1, Vector3 v2) // Get max value for each pair of components
- Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c) // Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c) NOTE: Assumes P is on the plane of the triangle
- Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view) // Projects a Vector3 from screen space into object space NOTE: We are avoiding calling other raymath functions despite available
- float3 Vector3ToFloatV(Vector3 v) // Get Vector3 as float array
- Vector3 Vector3Invert(Vector3 v) // Invert the given vector
- Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max) // Clamp the components of the vector between min and max values specified by the given vectors
- Vector3 Vector3ClampValue(Vector3 v, float min, float max) // Clamp the magnitude of the vector between two values
- int Vector3Equals(Vector3 p, Vector3 q) // Check whether two given vectors are almost equal
- Vector3 Vector3Refract(Vector3 v, Vector3 n, float r) // Compute the direction of a refracted ray where v specifies the normalized direction of the incoming ray, n specifies the normalized normal vector of the interface of two optical media, and r specifies the ratio of the refractive index of the medium from where the ray comes to the refractive index of the medium on the other side of the surface
-
- // Matrix math
- float MatrixDeterminant(Matrix mat) // Compute matrix determinant
- float MatrixTrace(Matrix mat) // Get the trace of the matrix (sum of the values along the diagonal)
- Matrix MatrixTranspose(Matrix mat) // Transposes provided matrix
- Matrix MatrixInvert(Matrix mat) // Invert provided matrix
- Matrix MatrixIdentity(void) // Get identity matrix
- Matrix MatrixAdd(Matrix left, Matrix right) // Add two matrices
- Matrix MatrixSubtract(Matrix left, Matrix right) // Subtract two matrices (left - right)
- Matrix MatrixMultiply(Matrix left, Matrix right) // Get two matrix multiplication NOTE: When multiplying matrices... the order matters!
- Matrix MatrixTranslate(float x, float y, float z) // Get translation matrix
- Matrix MatrixRotate(Vector3 axis, float angle) // Create rotation matrix from axis and angle NOTE: Angle should be provided in radians
- Matrix MatrixRotateX(float angle) // Get x-rotation matrix NOTE: Angle must be provided in radians
- Matrix MatrixRotateY(float angle) // Get y-rotation matrix NOTE: Angle must be provided in radians
- Matrix MatrixRotateZ(float angle) // Get z-rotation matrix NOTE: Angle must be provided in radians
- Matrix MatrixRotateXYZ(Vector3 angle) // Get xyz-rotation matrix NOTE: Angle must be provided in radians
- Matrix MatrixRotateZYX(Vector3 angle) // Get zyx-rotation matrix NOTE: Angle must be provided in radians
- Matrix MatrixScale(float x, float y, float z) // Get scaling matrix
- Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far) // Get perspective projection matrix
- Matrix MatrixPerspective(double fovy, double aspect, double near, double far) // Get perspective projection matrix NOTE: Fovy angle must be provided in radians
- Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far) // Get orthographic projection matrix
- Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up) // Get camera look-at matrix (view matrix)
- float16 MatrixToFloatV(Matrix mat) // Get float array of matrix data
-
- // Quaternion math
- Quaternion QuaternionAdd(Quaternion q1, Quaternion q2) // Add two quaternions
- Quaternion QuaternionAddValue(Quaternion q, float add) // Add quaternion and float value
- Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2) // Subtract two quaternions
- Quaternion QuaternionSubtractValue(Quaternion q, float sub) // Subtract quaternion and float value
- Quaternion QuaternionIdentity(void) // Get identity quaternion
- float QuaternionLength(Quaternion q) // Computes the length of a quaternion
- Quaternion QuaternionNormalize(Quaternion q) // Normalize provided quaternion
- Quaternion QuaternionInvert(Quaternion q) // Invert provided quaternion
- Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2) // Calculate two quaternion multiplication
- Quaternion QuaternionScale(Quaternion q, float mul) // Scale quaternion by float value
- Quaternion QuaternionDivide(Quaternion q1, Quaternion q2) // Divide two quaternions
- Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount) // Calculate linear interpolation between two quaternions
- Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount) // Calculate slerp-optimized interpolation between two quaternions
- Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount) // Calculates spherical linear interpolation between two quaternions
- Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to) // Calculate quaternion based on the rotation from one vector to another
- Quaternion QuaternionFromMatrix(Matrix mat) // Get a quaternion for a given rotation matrix
- Matrix QuaternionToMatrix(Quaternion q) // Get a matrix for a given quaternion
- Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle) // Get rotation quaternion for an angle and axis NOTE: Angle must be provided in radians
- void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle) // Get the rotation angle and axis for a given quaternion
- Quaternion QuaternionFromEuler(float pitch, float yaw, float roll) // Get the quaternion equivalent to Euler angles NOTE: Rotation order is ZYX
- Vector3 QuaternionToEuler(Quaternion q) // Get the Euler angles equivalent to quaternion (roll, pitch, yaw) NOTE: Angles are returned in a Vector3 struct in radians
- Quaternion QuaternionTransform(Quaternion q, Matrix mat) // Transform a quaternion given a transformation matrix
- int QuaternionEquals(Quaternion p, Quaternion q) // Check whether two given quaternions are almost equal
diff --git a/cheatsheet/raylib_models.c b/cheatsheet/raylib_models.c
index fea4c25..167ade0 100644
--- a/cheatsheet/raylib_models.c
+++ b/cheatsheet/raylib_models.c
@@ -8,8 +8,6 @@
void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version)
- void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured
- void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); // Draw cube with a region of a texture
void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere
void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters
void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires
@@ -17,6 +15,8 @@
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
void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires
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
+ 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
+ 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
void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ
void DrawRay(Ray ray, Color color); // Draw a ray line
void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
@@ -28,16 +28,16 @@
// Model management functions
Model LoadModel(const char *fileName); // Load model from files (meshes and materials)
Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material)
+ bool IsModelReady(Model model); // Check if a model is ready
void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM)
- void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM)
BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes)
// Model drawing functions
- void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
+ void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
- void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
+ void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
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
- void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
+ void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); // Draw a billboard texture
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source
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
@@ -68,6 +68,7 @@
// Material loading/unloading functions
Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file
Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
+ bool IsMaterialReady(Material material); // Check if a material is ready
void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM)
void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)
void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh
diff --git a/cheatsheet/raylib_shapes.c b/cheatsheet/raylib_shapes.c
index de409df..0c3a003 100644
--- a/cheatsheet/raylib_shapes.c
+++ b/cheatsheet/raylib_shapes.c
@@ -48,6 +48,7 @@
bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle
bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle
bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle
+ bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices
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
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]
Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision
diff --git a/cheatsheet/raylib_text.c b/cheatsheet/raylib_text.c
index e283f79..4887afe 100644
--- a/cheatsheet/raylib_text.c
+++ b/cheatsheet/raylib_text.c
@@ -4,6 +4,7 @@
Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
+ bool IsFontReady(Font font); // Check if a font is ready
GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use
Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM)
@@ -26,12 +27,15 @@
Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found
// Text codepoints management functions (unicode characters)
- int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
- void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory
- int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string
- int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
- const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
- char *TextCodepointsToUTF8(const int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!)
+ char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array
+ void UnloadUTF8(char *text); // Unload UTF-8 text encoded from codepoints array
+ int *LoadCodepoints(const char *text, int *count); // Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
+ void UnloadCodepoints(int *codepoints); // Unload codepoints data from memory
+ int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string
+ int GetCodepoint(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
+ int GetCodepointNext(const char *text, int *codepointSize); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
+ int GetCodepointPrevious(const char *text, int *codepointSize); // Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
+ const char *CodepointToUTF8(int codepoint, int *utf8Size); // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
// Text strings management functions (no UTF-8 strings, only byte chars)
// NOTE: Some strings allocate memory internally for returned strings, just be careful!
diff --git a/cheatsheet/raylib_textures.c b/cheatsheet/raylib_textures.c
index 44bf3f8..272c3ea 100644
--- a/cheatsheet/raylib_textures.c
+++ b/cheatsheet/raylib_textures.c
@@ -1,11 +1,12 @@
// Image loading functions
- // NOTE: This functions do not require GPU access
+ // NOTE: These functions do not require GPU access
Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM)
Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data)
Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png'
Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data
Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot)
+ bool IsImageReady(Image image); // Check if an image is ready
void UnloadImage(Image image); // Unload image from CPU memory (RAM)
bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success
bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success
@@ -17,7 +18,9 @@
Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise
+ Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise
Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm, bigger tileSize means bigger cells
+ Image GenImageText(int width, int height, const char *text); // Generate image: grayscale image from text data
// Image manipulation functions
Image ImageCopy(Image image); // Create an image duplicate (useful for transformations)
@@ -31,6 +34,7 @@
void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
+ void ImageBlurGaussian(Image *image, int blurSize); // Apply Gaussian blur using a box blur approximation
void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
@@ -60,8 +64,10 @@
void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version)
void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image
void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version)
- void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image
- void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version)
+ void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw a filled circle within an image
+ void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw a filled circle within an image (Vector version)
+ void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle outline within an image
+ void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version)
void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image
void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version)
void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image
@@ -76,7 +82,9 @@
Texture2D LoadTextureFromImage(Image image); // Load texture from image data
TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported
RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer)
+ bool IsTextureReady(Texture2D texture); // Check if a texture is ready
void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
+ bool IsRenderTextureReady(RenderTexture2D target); // Check if a render texture is ready
void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM)
void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data
void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data
@@ -91,11 +99,8 @@
void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2
void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
- void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters
- void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest.
- 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
- 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
- void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint); // Draw a textured polygon
+ 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
+ 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
// Color/pixel related functions
Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
@@ -104,6 +109,9 @@
Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1]
Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1]
Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1]
+ Color ColorTint(Color color, Color tint); // Get color multiplied with another color
+ Color ColorBrightness(Color color, float factor); // Get color with brightness correction, brightness factor goes from -1.0f to 1.0f
+ Color ColorContrast(Color color, float contrast); // Get color with contrast correction, contrast values between -1.0f and 1.0f
Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint
Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value