33
33
*
34
34
* OPTIONAL DEPENDENCIES (included):
35
35
* [rcore] msf_gif (Miles Fogle) for GIF recording
36
- * [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorythm
37
- * [rcore] sdefl (Micha Mettke) for DEFLATE compression algorythm
36
+ * [rcore] sinfl (Micha Mettke) for DEFLATE decompression algorithm
37
+ * [rcore] sdefl (Micha Mettke) for DEFLATE compression algorithm
38
38
* [rtextures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...)
39
39
* [rtextures] stb_image_write (Sean Barret) for image writing (BMP, TGA, PNG, JPG)
40
40
* [rtextures] stb_image_resize (Sean Barret) for image resizing algorithms
@@ -210,7 +210,7 @@ typedef struct Mesh {
210
210
// Vertex attributes data
211
211
float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
212
212
float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
213
- float *texcoords2; // Vertex second texture coordinates (useful for lightmaps ) (shader-location = 5)
213
+ float *texcoords2; // Vertex texture second coordinates (UV - 2 components per vertex ) (shader-location = 5)
214
214
float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
215
215
float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
216
216
unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
@@ -297,10 +297,14 @@ typedef struct Wave {
297
297
unsigned int channels; // Number of channels (1-mono, 2-stereo, ...)
298
298
void *data; // Buffer data pointer
299
299
} Wave;
300
+ // Opaque structs declaration
301
+ // NOTE: Actual structs are defined internally in raudio module
300
302
typedef struct rAudioBuffer rAudioBuffer;
303
+ typedef struct rAudioProcessor rAudioProcessor;
301
304
// AudioStream, custom audio stream
302
305
typedef struct AudioStream {
303
306
rAudioBuffer *buffer; // Pointer to internal data used by the audio system
307
+ rAudioProcessor *processor; // Pointer to internal data processor, useful for audio effects
304
308
unsigned int sampleRate; // Frequency (samples per second)
305
309
unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
306
310
unsigned int channels; // Number of channels (1-mono, 2-stereo, ...)
@@ -771,6 +775,8 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
771
775
const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
772
776
void SetClipboardText(const char *text); // Set clipboard text content
773
777
const char *GetClipboardText(void); // Get clipboard text content
778
+ void EnableEventWaiting(void); // Enable waiting for events on EndDrawing(), no automatic event polling
779
+ void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling
774
780
// Custom frame control functions
775
781
// NOTE: Those functions are intended for advance users that want full control over the frame processing
776
782
// By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
@@ -851,6 +857,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
851
857
unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read)
852
858
void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData()
853
859
bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success
860
+ bool ExportDataAsCode(const char *data, unsigned int size, const char *fileName); // Export data to code (.h), returns true on success
854
861
char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string
855
862
void UnloadFileText(char *text); // Unload file text data allocated by LoadFileText()
856
863
bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success
@@ -865,18 +872,18 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
865
872
const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string)
866
873
const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
867
874
const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string)
868
- char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed)
875
+ char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory must be freed)
869
876
void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory)
870
877
bool ChangeDirectory(const char *dir); // Change working directory, return true on success
871
878
bool IsFileDropped(void); // Check if a file has been dropped into window
872
- char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed)
879
+ char **GetDroppedFiles(int *count); // Get dropped files names (memory must be freed)
873
880
void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory)
874
881
long GetFileModTime(const char *fileName); // Get file modification time (last write time)
875
882
// Compression/Encoding functionality
876
- unsigned char *CompressData(const unsigned char *data, int dataLength , int *compDataLength ); // Compress data (DEFLATE algorithm)
877
- unsigned char *DecompressData(const unsigned char *compData, int compDataLength , int *dataLength ); // Decompress data (DEFLATE algorithm)
878
- char *EncodeDataBase64(const unsigned char *data, int dataLength , int *outputLength ); // Encode data to Base64 string
879
- unsigned char *DecodeDataBase64(const unsigned char *data, int *outputLength ); // Decode Base64 string data
883
+ unsigned char *CompressData(const unsigned char *data, int dataSize , int *compDataSize ); // Compress data (DEFLATE algorithm), memory must be MemFree( )
884
+ unsigned char *DecompressData(const unsigned char *compData, int compDataSize , int *dataSize ); // Decompress data (DEFLATE algorithm), memory must be MemFree( )
885
+ char *EncodeDataBase64(const unsigned char *data, int dataSize , int *outputSize ); // Encode data to Base64 string, memory must be MemFree()
886
+ unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize ); // Decode Base64 string data, memory must be MemFree()
880
887
// Persistent storage management
881
888
bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success
882
889
int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position)
@@ -1240,13 +1247,13 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
1240
1247
bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Check collision between box and sphere
1241
1248
RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); // Get collision info between ray and sphere
1242
1249
RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); // Get collision info between ray and box
1243
- RayCollision GetRayCollisionModel(Ray ray, Model model); // Get collision info between ray and model
1244
1250
RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh
1245
1251
RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle
1246
1252
RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); // Get collision info between ray and quad
1247
1253
//------------------------------------------------------------------------------------
1248
1254
// Audio Loading and Playing Functions (Module: audio)
1249
1255
//------------------------------------------------------------------------------------
1256
+ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
1250
1257
// Audio device management functions
1251
1258
void InitAudioDevice(void); // Initialize audio device and context
1252
1259
void CloseAudioDevice(void); // Close the audio device and context
@@ -1308,4 +1315,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
1308
1315
void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level)
1309
1316
void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level)
1310
1317
void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered)
1311
- void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
1318
+ void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams
1319
+ void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); // Audio thread callback to request new data
1320
+ void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor);
1321
+ void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor);
0 commit comments