This commit is contained in:
Richard Smith 2024-10-17 15:58:59 +01:00
parent cfad3eacaa
commit 1817fec006
16 changed files with 287 additions and 217 deletions

View file

@ -182,6 +182,12 @@ def ColorToInt(color: Color,) -> int:
def CompressData(data: str,dataSize: int,compDataSize: Any,) -> str:
"""Compress data (DEFLATE algorithm), memory must be MemFree()"""
...
def ComputeCRC32(data: str,dataSize: int,) -> int:
"""Compute CRC32 hash code"""
...
def ComputeMD5(data: str,dataSize: int,) -> Any:
"""Compute MD5 hash code, returns static int[4] (16 bytes)"""
...
def CreatePhysicsBodyCircle(pos: Vector2,radius: float,density: float,) -> Any:
"""Creates a new circle physics body with generic parameters"""
...
@ -1597,8 +1603,8 @@ def IsAudioStreamPlaying(stream: AudioStream,) -> bool:
def IsAudioStreamProcessed(stream: AudioStream,) -> bool:
"""Check if any audio stream buffers requires refill"""
...
def IsAudioStreamReady(stream: AudioStream,) -> bool:
"""Checks if an audio stream is ready"""
def IsAudioStreamValid(stream: AudioStream,) -> bool:
"""Checks if an audio stream is valid (buffers initialized)"""
...
def IsCursorHidden() -> bool:
"""Check if cursor is not visible"""
@ -1615,8 +1621,8 @@ def IsFileExtension(fileName: str,ext: str,) -> bool:
def IsFileNameValid(fileName: str,) -> bool:
"""Check if fileName is valid for the platform/OS"""
...
def IsFontReady(font: Font,) -> bool:
"""Check if a font is ready"""
def IsFontValid(font: Font,) -> bool:
"""Check if a font is valid (font data loaded, WARNING: GPU texture not checked)"""
...
def IsGamepadAvailable(gamepad: int,) -> bool:
"""Check if a gamepad is available"""
@ -1636,8 +1642,8 @@ def IsGamepadButtonUp(gamepad: int,button: int,) -> bool:
def IsGestureDetected(gesture: int,) -> bool:
"""Check if a gesture have been detected"""
...
def IsImageReady(image: Image,) -> bool:
"""Check if an image is ready"""
def IsImageValid(image: Image,) -> bool:
"""Check if an image is valid (data and parameters)"""
...
def IsKeyDown(key: int,) -> bool:
"""Check if a key is being pressed"""
@ -1654,14 +1660,14 @@ def IsKeyReleased(key: int,) -> bool:
def IsKeyUp(key: int,) -> bool:
"""Check if a key is NOT being pressed"""
...
def IsMaterialReady(material: Material,) -> bool:
"""Check if a material is ready"""
def IsMaterialValid(material: Material,) -> bool:
"""Check if a material is valid (shader assigned, map textures loaded in GPU)"""
...
def IsModelAnimationValid(model: Model,anim: ModelAnimation,) -> bool:
"""Check model animation skeleton match"""
...
def IsModelReady(model: Model,) -> bool:
"""Check if a model is ready"""
def IsModelValid(model: Model,) -> bool:
"""Check if a model is valid (loaded in GPU, VAO/VBOs)"""
...
def IsMouseButtonDown(button: int,) -> bool:
"""Check if a mouse button is being pressed"""
@ -1675,32 +1681,32 @@ def IsMouseButtonReleased(button: int,) -> bool:
def IsMouseButtonUp(button: int,) -> bool:
"""Check if a mouse button is NOT being pressed"""
...
def IsMusicReady(music: Music,) -> bool:
"""Checks if a music stream is ready"""
...
def IsMusicStreamPlaying(music: Music,) -> bool:
"""Check if music is playing"""
...
def IsMusicValid(music: Music,) -> bool:
"""Checks if a music stream is valid (context and buffers initialized)"""
...
def IsPathFile(path: str,) -> bool:
"""Check if a given path is a file or a directory"""
...
def IsRenderTextureReady(target: RenderTexture,) -> bool:
"""Check if a render texture is ready"""
def IsRenderTextureValid(target: RenderTexture,) -> bool:
"""Check if a render texture is valid (loaded in GPU)"""
...
def IsShaderReady(shader: Shader,) -> bool:
"""Check if a shader is ready"""
def IsShaderValid(shader: Shader,) -> bool:
"""Check if a shader is valid (loaded on GPU)"""
...
def IsSoundPlaying(sound: Sound,) -> bool:
"""Check if a sound is currently playing"""
...
def IsSoundReady(sound: Sound,) -> bool:
"""Checks if a sound is ready"""
def IsSoundValid(sound: Sound,) -> bool:
"""Checks if a sound is valid (data loaded and buffers initialized)"""
...
def IsTextureReady(texture: Texture,) -> bool:
"""Check if a texture is ready"""
def IsTextureValid(texture: Texture,) -> bool:
"""Check if a texture is valid (loaded in GPU)"""
...
def IsWaveReady(wave: Wave,) -> bool:
"""Checks if wave data is ready"""
def IsWaveValid(wave: Wave,) -> bool:
"""Checks if wave data is valid (data loaded and parameters)"""
...
def IsWindowFocused() -> bool:
"""Check if window is currently focused (only PLATFORM_DESKTOP)"""

View file

@ -849,7 +849,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// 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
bool IsShaderValid(Shader shader); // Check if a shader is valid (loaded on GPU)
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
@ -938,6 +938,8 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize); // Decompress data (DEFLATE algorithm), memory must be MemFree()
char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize); // Encode data to Base64 string, memory must be MemFree()
unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize); // Decode Base64 string data, memory must be MemFree()
unsigned int ComputeCRC32(unsigned char *data, int dataSize); // Compute CRC32 hash code
unsigned int *ComputeMD5(unsigned char *data, int dataSize); // Compute MD5 hash code, returns static int[4] (16 bytes)
// Automation events functionality
AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file
@ -1096,7 +1098,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
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
bool IsImageValid(Image image); // Check if an image is valid (data and parameters)
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
unsigned char *ExportImageToMemory(Image image, const char *fileType, int *fileSize); // Export image to memory buffer
@ -1178,9 +1180,9 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
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
bool IsTextureValid(Texture2D texture); // Check if a texture is valid (loaded in GPU)
void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM)
bool IsRenderTextureReady(RenderTexture2D target); // Check if a render texture is ready
bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU)
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
@ -1222,7 +1224,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
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
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 *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
bool IsFontReady(Font font); // Check if a font is ready
bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked)
GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use
Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info
void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM)
@ -1303,7 +1305,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// 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
bool IsModelValid(Model model); // Check if a model is valid (loaded in GPU, VAO/VBOs)
void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM)
BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes)
// Model drawing functions
@ -1342,7 +1344,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
// 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
bool IsMaterialValid(Material material); // Check if a material is valid (shader assigned, map textures loaded in GPU)
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
@ -1375,11 +1377,11 @@ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
// 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
bool IsWaveValid(Wave wave); // Checks if wave data is valid (data loaded and parameters)
Sound LoadSound(const char *fileName); // Load sound from file
Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
Sound LoadSoundAlias(Sound source); // Create a new sound that shares the same sample data as the source sound, does not own the sound data
bool IsSoundReady(Sound sound); // Checks if a sound is ready
bool IsSoundValid(Sound sound); // Checks if a sound is valid (data loaded and buffers initialized)
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
@ -1403,7 +1405,7 @@ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
// 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
bool IsMusicValid(Music music); // Checks if a music stream is valid (context and buffers initialized)
void UnloadMusicStream(Music music); // Unload music stream
void PlayMusicStream(Music music); // Start music playing
bool IsMusicStreamPlaying(Music music); // Check if music is playing
@ -1419,7 +1421,7 @@ typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
// 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
bool IsAudioStreamValid(AudioStream stream); // Checks if an audio stream is valid (buffers initialized)
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