Skip to content

Commit 4b000fe

Browse files
latest raylib snapshot
1 parent ff40b0a commit 4b000fe

File tree

5 files changed

+36
-19
lines changed

5 files changed

+36
-19
lines changed

pyray/__init__.pyi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2523,6 +2523,11 @@ CFFI C function from raylib._raylib_cffi.lib"""
25232523
def rl_update_vertex_buffer(unsignedint_0: int,void_pointer_1: Any,int_2: int,int_3: int,) -> None:
25242524
"""void rlUpdateVertexBuffer(unsigned int, void *, int, int);
25252525
2526+
CFFI C function from raylib._raylib_cffi.lib"""
2527+
...
2528+
def rl_update_vertex_buffer_elements(unsignedint_0: int,void_pointer_1: Any,int_2: int,int_3: int,) -> None:
2529+
"""void rlUpdateVertexBufferElements(unsigned int, void *, int, int);
2530+
25262531
CFFI C function from raylib._raylib_cffi.lib"""
25272532
...
25282533
def rl_vertex2f(float_0: float,float_1: float,) -> None:
@@ -3206,7 +3211,8 @@ class BlendMode(IntEnum):
32063211
BLEND_MULTIPLIED = 2
32073212
BLEND_ADD_COLORS = 3
32083213
BLEND_SUBTRACT_COLORS = 4
3209-
BLEND_CUSTOM = 5
3214+
BLEND_ALPHA_PREMUL = 5
3215+
BLEND_CUSTOM = 6
32103216

32113217
class Gesture(IntEnum):
32123218
GESTURE_NONE = 0

raylib/__init__.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ BASE_COLOR_PRESSED: int
1414
BLEND_ADDITIVE: int
1515
BLEND_ADD_COLORS: int
1616
BLEND_ALPHA: int
17+
BLEND_ALPHA_PREMUL: int
1718
BLEND_CUSTOM: int
1819
BLEND_MULTIPLIED: int
1920
BLEND_SUBTRACT_COLORS: int
@@ -1787,6 +1788,7 @@ RL_ATTACHMENT_TEXTURE2D: int
17871788
RL_BLEND_ADDITIVE: int
17881789
RL_BLEND_ADD_COLORS: int
17891790
RL_BLEND_ALPHA: int
1791+
RL_BLEND_ALPHA_PREMUL: int
17901792
RL_BLEND_CUSTOM: int
17911793
RL_BLEND_MULTIPLIED: int
17921794
RL_BLEND_SUBTRACT_COLORS: int
@@ -2993,6 +2995,11 @@ CFFI C function from raylib._raylib_cffi.lib"""
29932995
def rlUpdateVertexBuffer(unsignedint_0: int,void_pointer_1: Any,int_2: int,int_3: int,) -> None:
29942996
"""void rlUpdateVertexBuffer(unsigned int, void *, int, int);
29952997
2998+
CFFI C function from raylib._raylib_cffi.lib"""
2999+
...
3000+
def rlUpdateVertexBufferElements(unsignedint_0: int,void_pointer_1: Any,int_2: int,int_3: int,) -> None:
3001+
"""void rlUpdateVertexBufferElements(unsigned int, void *, int, int);
3002+
29963003
CFFI C function from raylib._raylib_cffi.lib"""
29973004
...
29983005
def rlVertex2f(float_0: float,float_1: float,) -> None:

raylib/enums.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ class BlendMode(IntEnum):
302302
BLEND_MULTIPLIED = 2
303303
BLEND_ADD_COLORS = 3
304304
BLEND_SUBTRACT_COLORS = 4
305-
BLEND_CUSTOM = 5
305+
BLEND_ALPHA_PREMUL = 5
306+
BLEND_CUSTOM = 6
306307

307308
class Gesture(IntEnum):
308309
GESTURE_NONE = 0

raylib/raylib.h.modified

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ typedef enum {
677677
BLEND_MULTIPLIED, // Blend textures multiplying colors
678678
BLEND_ADD_COLORS, // Blend textures adding colors (alternative)
679679
BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative)
680+
BLEND_ALPHA_PREMUL, // Blend premultiplied textures considering alpha
680681
BLEND_CUSTOM // Blend textures using custom src/dst factors (use rlSetBlendMode())
681682
} BlendMode;
682683
// Gesture
@@ -872,10 +873,10 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
872873
void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory)
873874
long GetFileModTime(const char *fileName); // Get file modification time (last write time)
874875
// Compression/Encoding functionality
875-
unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm)
876-
unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm)
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)
877878
char *EncodeDataBase64(const unsigned char *data, int dataLength, int *outputLength); // Encode data to Base64 string
878-
unsigned char *DecodeDataBase64(unsigned char *data, int *outputLength); // Decode Base64 string data
879+
unsigned char *DecodeDataBase64(const unsigned char *data, int *outputLength); // Decode Base64 string data
879880
// Persistent storage management
880881
bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success
881882
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
11251126
void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters
11261127
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)
11271128
void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint)
1128-
void DrawTextCodepoints(Font font, int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint)
1129+
void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint)
11291130
// Text font info functions
11301131
int MeasureText(const char *text, int fontSize); // Measure string width for default font
11311132
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
11381139
int GetCodepointCount(const char *text); // Get total number of codepoints in a UTF-8 encoded string
11391140
int GetCodepoint(const char *text, int *bytesProcessed); // Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
11401141
const char *CodepointToUTF8(int codepoint, int *byteSize); // Encode one codepoint into UTF-8 byte array (array length returned as parameter)
1141-
char *TextCodepointsToUTF8(int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!)
1142+
char *TextCodepointsToUTF8(const int *codepoints, int length); // Encode text as codepoints array into UTF-8 text string (WARNING: memory must be freed!)
11421143
// Text strings management functions (no UTF-8 strings, only byte chars)
11431144
// NOTE: Some strings allocate memory internally for returned strings, just be careful!
11441145
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
12011202
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
12021203
// Mesh management functions
12031204
void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids
1204-
void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index
1205+
void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset); // Update mesh vertex data in GPU for a specific buffer index
12051206
void UnloadMesh(Mesh mesh); // Unload mesh data from CPU and GPU
12061207
void DrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform
1207-
void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms
1208+
void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances); // Draw multiple mesh instances with material and different transforms
12081209
bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success
12091210
BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
12101211
void GenMeshTangents(Mesh *mesh); // Compute mesh tangents
@@ -1231,7 +1232,7 @@ typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileI
12311232
ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount); // Load model animations from file
12321233
void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose
12331234
void UnloadModelAnimation(ModelAnimation anim); // Unload animation data
1234-
void UnloadModelAnimations(ModelAnimation* animations, unsigned int count); // Unload animation array data
1235+
void UnloadModelAnimations(ModelAnimation *animations, unsigned int count); // Unload animation array data
12351236
bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match
12361237
// Collision detection functions
12371238
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
12801281
void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples()
12811282
// Music management functions
12821283
Music LoadMusicStream(const char *fileName); // Load music stream from file
1283-
Music LoadMusicStreamFromMemory(const char *fileType, unsigned char *data, int dataSize); // Load music stream from data
1284+
Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data
12841285
void UnloadMusicStream(Music music); // Unload music stream
12851286
void PlayMusicStream(Music music); // Start music playing
12861287
bool IsMusicStreamPlaying(Music music); // Check if music is playing

raylib/rlgl.h.modified

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ typedef enum {
249249
RL_BLEND_MULTIPLIED, // Blend textures multiplying colors
250250
RL_BLEND_ADD_COLORS, // Blend textures adding colors (alternative)
251251
RL_BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative)
252+
RL_BLEND_ALPHA_PREMUL, // Blend premultiplied textures considering alpha
252253
RL_BLEND_CUSTOM // Blend textures using custom src/dst factors (use rlSetBlendFactors())
253254
} rlBlendMode;
254255
// Shader location point type
@@ -406,22 +407,23 @@ typedef enum {
406407
//------------------------------------------------------------------------------------------------------------------------
407408
// Vertex buffers management
408409
unsigned int rlLoadVertexArray(void); // Load vertex array (vao) if supported
409-
unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic); // Load a vertex buffer attribute
410-
unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic); // Load a new attributes element buffer
411-
void rlUpdateVertexBuffer(unsigned int bufferId, void *data, int dataSize, int offset); // Update GPU buffer with new data
410+
unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic); // Load a vertex buffer attribute
411+
unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic); // Load a new attributes element buffer
412+
void rlUpdateVertexBuffer(unsigned int bufferId, const void *data, int dataSize, int offset); // Update GPU buffer with new data
413+
void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset); // Update vertex buffer elements with new data
412414
void rlUnloadVertexArray(unsigned int vaoId);
413415
void rlUnloadVertexBuffer(unsigned int vboId);
414-
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer);
416+
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, const void *pointer);
415417
void rlSetVertexAttributeDivisor(unsigned int index, int divisor);
416418
void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count); // Set vertex attribute default value
417419
void rlDrawVertexArray(int offset, int count);
418-
void rlDrawVertexArrayElements(int offset, int count, void *buffer);
420+
void rlDrawVertexArrayElements(int offset, int count, const void *buffer);
419421
void rlDrawVertexArrayInstanced(int offset, int count, int instances);
420-
void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances);
422+
void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances);
421423
// Textures management
422-
unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU
424+
unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU
423425
unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo)
424-
unsigned int rlLoadTextureCubemap(void *data, int size, int format); // Load texture cubemap
426+
unsigned int rlLoadTextureCubemap(const void *data, int size, int format); // Load texture cubemap
425427
void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update GPU texture with new data
426428
void rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType); // Get OpenGL internal formats
427429
const char *rlGetPixelFormatName(unsigned int format); // Get name string for pixel format

0 commit comments

Comments
 (0)