From 4b000fecaaaec6b3685613afcdee69d1e0eab771 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 10 Mar 2022 00:10:24 +0000 Subject: [PATCH] latest raylib snapshot --- pyray/__init__.pyi | 8 +++++++- raylib/__init__.pyi | 7 +++++++ raylib/enums.py | 3 ++- raylib/raylib.h.modified | 19 ++++++++++--------- raylib/rlgl.h.modified | 18 ++++++++++-------- 5 files changed, 36 insertions(+), 19 deletions(-) diff --git a/pyray/__init__.pyi b/pyray/__init__.pyi index 7e4c0ca..79ea022 100644 --- a/pyray/__init__.pyi +++ b/pyray/__init__.pyi @@ -2523,6 +2523,11 @@ CFFI C function from raylib._raylib_cffi.lib""" def rl_update_vertex_buffer(unsignedint_0: int,void_pointer_1: Any,int_2: int,int_3: int,) -> None: """void rlUpdateVertexBuffer(unsigned int, void *, int, int); +CFFI C function from raylib._raylib_cffi.lib""" + ... +def rl_update_vertex_buffer_elements(unsignedint_0: int,void_pointer_1: Any,int_2: int,int_3: int,) -> None: + """void rlUpdateVertexBufferElements(unsigned int, void *, int, int); + CFFI C function from raylib._raylib_cffi.lib""" ... def rl_vertex2f(float_0: float,float_1: float,) -> None: @@ -3206,7 +3211,8 @@ class BlendMode(IntEnum): BLEND_MULTIPLIED = 2 BLEND_ADD_COLORS = 3 BLEND_SUBTRACT_COLORS = 4 - BLEND_CUSTOM = 5 + BLEND_ALPHA_PREMUL = 5 + BLEND_CUSTOM = 6 class Gesture(IntEnum): GESTURE_NONE = 0 diff --git a/raylib/__init__.pyi b/raylib/__init__.pyi index bc4ab28..72b44d7 100644 --- a/raylib/__init__.pyi +++ b/raylib/__init__.pyi @@ -14,6 +14,7 @@ BASE_COLOR_PRESSED: int BLEND_ADDITIVE: int BLEND_ADD_COLORS: int BLEND_ALPHA: int +BLEND_ALPHA_PREMUL: int BLEND_CUSTOM: int BLEND_MULTIPLIED: int BLEND_SUBTRACT_COLORS: int @@ -1787,6 +1788,7 @@ RL_ATTACHMENT_TEXTURE2D: int RL_BLEND_ADDITIVE: int RL_BLEND_ADD_COLORS: int RL_BLEND_ALPHA: int +RL_BLEND_ALPHA_PREMUL: int RL_BLEND_CUSTOM: int RL_BLEND_MULTIPLIED: int RL_BLEND_SUBTRACT_COLORS: int @@ -2993,6 +2995,11 @@ CFFI C function from raylib._raylib_cffi.lib""" def rlUpdateVertexBuffer(unsignedint_0: int,void_pointer_1: Any,int_2: int,int_3: int,) -> None: """void rlUpdateVertexBuffer(unsigned int, void *, int, int); +CFFI C function from raylib._raylib_cffi.lib""" + ... +def rlUpdateVertexBufferElements(unsignedint_0: int,void_pointer_1: Any,int_2: int,int_3: int,) -> None: + """void rlUpdateVertexBufferElements(unsigned int, void *, int, int); + CFFI C function from raylib._raylib_cffi.lib""" ... def rlVertex2f(float_0: float,float_1: float,) -> None: diff --git a/raylib/enums.py b/raylib/enums.py index 0b28e78..59de35d 100644 --- a/raylib/enums.py +++ b/raylib/enums.py @@ -302,7 +302,8 @@ class BlendMode(IntEnum): BLEND_MULTIPLIED = 2 BLEND_ADD_COLORS = 3 BLEND_SUBTRACT_COLORS = 4 - BLEND_CUSTOM = 5 + BLEND_ALPHA_PREMUL = 5 + BLEND_CUSTOM = 6 class Gesture(IntEnum): GESTURE_NONE = 0 diff --git a/raylib/raylib.h.modified b/raylib/raylib.h.modified index d5a94be..aeebd7b 100644 --- a/raylib/raylib.h.modified +++ b/raylib/raylib.h.modified @@ -677,6 +677,7 @@ typedef enum { BLEND_MULTIPLIED, // Blend textures multiplying colors BLEND_ADD_COLORS, // Blend textures adding colors (alternative) BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) + BLEND_ALPHA_PREMUL, // Blend premultiplied textures considering alpha BLEND_CUSTOM // Blend textures using custom src/dst factors (use rlSetBlendMode()) } BlendMode; // Gesture @@ -872,10 +873,10 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) long GetFileModTime(const char *fileName); // Get file modification time (last write time) // Compression/Encoding functionality - unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm) - unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm) + unsigned char *CompressData(const unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm) + unsigned char *DecompressData(const unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm) char *EncodeDataBase64(const unsigned char *data, int dataLength, int *outputLength); // Encode data to Base64 string - unsigned char *DecodeDataBase64(unsigned char *data, int *outputLength); // Decode Base64 string data + unsigned char *DecodeDataBase64(const unsigned char *data, int *outputLength); // Decode Base64 string data // Persistent storage management bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position) @@ -1125,7 +1126,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters 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) void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) - void DrawTextCodepoints(Font font, int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) + void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) // Text font info functions int MeasureText(const char *text, int fontSize); // Measure string width for default font Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font @@ -1138,7 +1139,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI 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(int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) + char *TextCodepointsToUTF8(const int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!) // Text strings management functions (no UTF-8 strings, only byte chars) // NOTE: Some strings allocate memory internally for returned strings, just be careful! int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied @@ -1201,10 +1202,10 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI 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 // Mesh management functions void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids - void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index + void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform - void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms + void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits void GenMeshTangents(Mesh *mesh); // Compute mesh tangents @@ -1231,7 +1232,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose void UnloadModelAnimation(ModelAnimation anim); // Unload animation data - void UnloadModelAnimations(ModelAnimation* animations, unsigned int count); // Unload animation array data + void UnloadModelAnimations(ModelAnimation *animations, unsigned int count); // Unload animation array data bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match // Collision detection functions bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Check collision between two spheres @@ -1280,7 +1281,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() // Music management functions Music LoadMusicStream(const char *fileName); // Load music stream from file - Music LoadMusicStreamFromMemory(const char *fileType, unsigned char *data, int dataSize); // Load music stream from data + Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data void UnloadMusicStream(Music music); // Unload music stream void PlayMusicStream(Music music); // Start music playing bool IsMusicStreamPlaying(Music music); // Check if music is playing diff --git a/raylib/rlgl.h.modified b/raylib/rlgl.h.modified index 1dec460..c6b80e2 100644 --- a/raylib/rlgl.h.modified +++ b/raylib/rlgl.h.modified @@ -249,6 +249,7 @@ typedef enum { RL_BLEND_MULTIPLIED, // Blend textures multiplying colors RL_BLEND_ADD_COLORS, // Blend textures adding colors (alternative) RL_BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) + RL_BLEND_ALPHA_PREMUL, // Blend premultiplied textures considering alpha RL_BLEND_CUSTOM // Blend textures using custom src/dst factors (use rlSetBlendFactors()) } rlBlendMode; // Shader location point type @@ -406,22 +407,23 @@ typedef enum { //------------------------------------------------------------------------------------------------------------------------ // Vertex buffers management unsigned int rlLoadVertexArray(void); // Load vertex array (vao) if supported - unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic); // Load a vertex buffer attribute - unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic); // Load a new attributes element buffer - void rlUpdateVertexBuffer(unsigned int bufferId, void *data, int dataSize, int offset); // Update GPU buffer with new data + unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic); // Load a vertex buffer attribute + unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic); // Load a new attributes element buffer + void rlUpdateVertexBuffer(unsigned int bufferId, const void *data, int dataSize, int offset); // Update GPU buffer with new data + void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset); // Update vertex buffer elements with new data void rlUnloadVertexArray(unsigned int vaoId); void rlUnloadVertexBuffer(unsigned int vboId); - void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer); + void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, const void *pointer); void rlSetVertexAttributeDivisor(unsigned int index, int divisor); void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count); // Set vertex attribute default value void rlDrawVertexArray(int offset, int count); - void rlDrawVertexArrayElements(int offset, int count, void *buffer); + void rlDrawVertexArrayElements(int offset, int count, const void *buffer); void rlDrawVertexArrayInstanced(int offset, int count, int instances); - void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances); + void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances); // Textures management - unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU + unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo) - unsigned int rlLoadTextureCubemap(void *data, int size, int format); // Load texture cubemap + unsigned int rlLoadTextureCubemap(const void *data, int size, int format); // Load texture cubemap void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update GPU texture with new data void rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType); // Get OpenGL internal formats const char *rlGetPixelFormatName(unsigned int format); // Get name string for pixel format