Skip to content

Commit f73c57c

Browse files
update raylib to 4.1-dev
1 parent 10d945e commit f73c57c

File tree

9 files changed

+106
-34
lines changed

9 files changed

+106
-34
lines changed

create_stub_pyray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def pointer(struct):
6868
" ", "")+"_"+str(i)
6969
if 'params' in json_object:
7070
p = json_object['params']
71-
param_name = list(p)[i]
71+
param_name = list(p)[i]['name']
7272

7373
param_type = ctype_to_python_type(arg.cname)
7474
sig += f"{param_name}: {param_type},"
@@ -101,7 +101,7 @@ def pointer(struct):
101101
# json_object = json_array[0]
102102
if ffi.typeof(struct).kind == "struct":
103103
if ffi.typeof(struct).fields is None:
104-
print("weird empty struct, skipping", file=sys.stderr)
104+
print("weird empty struct, skipping "+struct, file=sys.stderr)
105105
break
106106
print(f"class {struct}:")
107107
print(f' """ struct """')

create_stub_static.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class struct: ...
6969
if 'params' in json_object:
7070
p = json_object['params']
7171
#print("param_name: ", param_name, "i", i, "params: ",p,file=sys.stderr)
72-
param_name = list(p)[i]
72+
param_name = list(p)[i]['name']
7373
param_type = ctype_to_python_type(arg.cname)
7474
sig += f"{param_name}: {param_type},"
7575

pyray/__init__.pyi

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ def draw_text(text: str,posX: int,posY: int,fontSize: int,color: Color,) -> None
341341
def draw_text_codepoint(font: Font,codepoint: int,position: Vector2,fontSize: float,tint: Color,) -> None:
342342
"""Draw one character (codepoint)"""
343343
...
344+
def draw_text_codepoints(font: Font,codepoints: Any,count: int,position: Vector2,fontSize: float,spacing: float,tint: Color,) -> None:
345+
"""Draw multiple character (codepoint)"""
346+
...
344347
def draw_text_ex(font: Font,text: str,position: Vector2,fontSize: float,spacing: float,tint: Color,) -> None:
345348
"""Draw text using font and additional parameters"""
346349
...
@@ -422,6 +425,9 @@ def end_texture_mode() -> None:
422425
def end_vr_stereo_mode() -> None:
423426
"""End stereo rendering (requires VR simulator)"""
424427
...
428+
def export_font_as_code(font: Font,fileName: str,) -> bool:
429+
"""Export font as code file, returns true on success"""
430+
...
425431
def export_image(image: Image,fileName: str,) -> bool:
426432
"""Export image data to file, returns true on success"""
427433
...
@@ -509,6 +515,9 @@ def gen_mesh_torus(radius: float,size: float,radSeg: int,sides: int,) -> Mesh:
509515
def gen_texture_mipmaps(texture: Any,) -> None:
510516
"""Generate GPU mipmaps for a texture"""
511517
...
518+
def get_application_directory() -> str:
519+
"""Get the directory if the running application (uses static string)"""
520+
...
512521
def get_camera_matrix(camera: Camera3D,) -> Matrix:
513522
"""Get camera transform matrix (view matrix)"""
514523
...
@@ -551,6 +560,9 @@ def get_fps() -> int:
551560
def get_file_extension(fileName: str,) -> str:
552561
"""Get pointer to extension for a filename string (includes dot: '.png')"""
553562
...
563+
def get_file_length(fileName: str,) -> int:
564+
"""Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)"""
565+
...
554566
def get_file_mod_time(fileName: str,) -> int:
555567
"""Get file modification time (last write time)"""
556568
...
@@ -723,6 +735,12 @@ def get_ray_collision_sphere(ray: Ray,center: Vector3,radius: float,) -> RayColl
723735
def get_ray_collision_triangle(ray: Ray,p1: Vector3,p2: Vector3,p3: Vector3,) -> RayCollision:
724736
"""Get collision info between ray and triangle"""
725737
...
738+
def get_render_height() -> int:
739+
"""Get current render height (it considers HiDPI)"""
740+
...
741+
def get_render_width() -> int:
742+
"""Get current render width (it considers HiDPI)"""
743+
...
726744
def get_screen_height() -> int:
727745
"""Get current screen height"""
728746
...
@@ -1290,7 +1308,7 @@ def load_file_data(fileName: str,bytesRead: Any,) -> str:
12901308
"""Load file data as byte array (read)"""
12911309
...
12921310
def load_file_text(fileName: str,) -> str:
1293-
"""Load text data from file (read), returns a ' 0' terminated string"""
1311+
"""Load text data from file (read), returns a '\0' terminated string"""
12941312
...
12951313
def load_font(fileName: str,) -> Font:
12961314
"""Load font from file into GPU memory (VRAM)"""
@@ -1299,7 +1317,7 @@ def load_font_data(fileData: str,dataSize: int,fontSize: int,fontChars: Any,glyp
12991317
"""Load font data for further use"""
13001318
...
13011319
def load_font_ex(fileName: str,fontSize: int,fontChars: Any,glyphCount: int,) -> Font:
1302-
"""Load font from file with extended parameters"""
1320+
"""Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set"""
13031321
...
13041322
def load_font_from_image(image: Image,key: Color,firstChar: int,) -> Font:
13051323
"""Load font from Image (XNA style)"""
@@ -1389,7 +1407,7 @@ def load_wave_from_memory(fileType: str,fileData: str,dataSize: int,) -> Wave:
13891407
"""Load wave from memory buffer, fileType refers to extension: i.e. '.wav'"""
13901408
...
13911409
def load_wave_samples(wave: Wave,) -> Any:
1392-
"""Load samples data from wave as a floats array"""
1410+
"""Load samples data from wave as a 32bit float data array"""
13931411
...
13941412
def maximize_window() -> None:
13951413
"""Set window state: maximized, if resizable (only PLATFORM_DESKTOP)"""
@@ -1475,7 +1493,7 @@ def save_file_data(fileName: str,data: Any,bytesToWrite: int,) -> bool:
14751493
"""Save data to file from byte array (write), returns true on success"""
14761494
...
14771495
def save_file_text(fileName: str,text: str,) -> bool:
1478-
"""Save text data to file (write), string must be ' 0' terminated, returns true on success"""
1496+
"""Save text data to file (write), string must be '\0' terminated, returns true on success"""
14791497
...
14801498
def save_storage_value(position: int,value: int,) -> bool:
14811499
"""Save integer value to storage file (to defined position), returns true on success"""
@@ -1486,6 +1504,9 @@ def seek_music_stream(music: Music,position: float,) -> None:
14861504
def set_audio_stream_buffer_size_default(size: int,) -> None:
14871505
"""Default size for new audio streams"""
14881506
...
1507+
def set_audio_stream_pan(stream: AudioStream,pan: float,) -> None:
1508+
"""Set pan for audio stream (0.5 is centered)"""
1509+
...
14891510
def set_audio_stream_pitch(stream: AudioStream,pitch: float,) -> None:
14901511
"""Set pitch for audio stream (1.0 is base level)"""
14911512
...
@@ -1549,6 +1570,9 @@ def set_mouse_position(x: int,y: int,) -> None:
15491570
def set_mouse_scale(scaleX: float,scaleY: float,) -> None:
15501571
"""Set mouse scaling"""
15511572
...
1573+
def set_music_pan(music: Music,pan: float,) -> None:
1574+
"""Set pan for a music (0.5 is center)"""
1575+
...
15521576
def set_music_pitch(music: Music,pitch: float,) -> None:
15531577
"""Set pitch for a music (1.0 is base level)"""
15541578
...
@@ -1597,6 +1621,9 @@ def set_shader_value_v(shader: Shader,locIndex: int,value: Any,uniformType: int,
15971621
def set_shapes_texture(texture: Texture,source: Rectangle,) -> None:
15981622
"""Set texture and rectangle to be used on shapes drawing"""
15991623
...
1624+
def set_sound_pan(sound: Sound,pan: float,) -> None:
1625+
"""Set pan for a sound (0.5 is center)"""
1626+
...
16001627
def set_sound_pitch(sound: Sound,pitch: float,) -> None:
16011628
"""Set pitch for a sound (1.0 is base level)"""
16021629
...
@@ -1627,14 +1654,17 @@ def set_window_min_size(width: int,height: int,) -> None:
16271654
def set_window_monitor(monitor: int,) -> None:
16281655
"""Set monitor for the current window (fullscreen mode)"""
16291656
...
1657+
def set_window_opacity(opacity: float,) -> None:
1658+
"""Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)"""
1659+
...
16301660
def set_window_position(x: int,y: int,) -> None:
16311661
"""Set window position on screen (only PLATFORM_DESKTOP)"""
16321662
...
16331663
def set_window_size(width: int,height: int,) -> None:
16341664
"""Set window dimensions"""
16351665
...
16361666
def set_window_state(flags: int,) -> None:
1637-
"""Set window configuration state using flags"""
1667+
"""Set window configuration state using flags (only PLATFORM_DESKTOP)"""
16381668
...
16391669
def set_window_title(title: str,) -> None:
16401670
"""Set title for window (only PLATFORM_DESKTOP)"""
@@ -1685,7 +1715,7 @@ def text_join(textList: str,count: int,delimiter: str,) -> str:
16851715
"""Join text strings with delimiter"""
16861716
...
16871717
def text_length(text: str,) -> int:
1688-
"""Get text length, checks for ' 0' ending"""
1718+
"""Get text length, checks for '\0' ending"""
16891719
...
16901720
def text_replace(text: str,replace: str,by: str,) -> str:
16911721
"""Replace text string (WARNING: memory must be freed!)"""
@@ -1727,7 +1757,7 @@ def unload_file_text(text: str,) -> None:
17271757
"""Unload file text data allocated by LoadFileText()"""
17281758
...
17291759
def unload_font(font: Font,) -> None:
1730-
"""Unload Font from GPU memory (VRAM)"""
1760+
"""Unload font from GPU memory (VRAM)"""
17311761
...
17321762
def unload_font_data(chars: Any,glyphCount: int,) -> None:
17331763
"""Unload font chars info data (RAM)"""

raylib-c

Submodule raylib-c updated 190 files

raylib/__init__.pyi

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ def DrawText(text: str,posX: int,posY: int,fontSize: int,color: Color,) -> None:
385385
def DrawTextCodepoint(font: Font,codepoint: int,position: Vector2,fontSize: float,tint: Color,) -> None:
386386
"""Draw one character (codepoint)"""
387387
...
388+
def DrawTextCodepoints(font: Font,codepoints: Any,count: int,position: Vector2,fontSize: float,spacing: float,tint: Color,) -> None:
389+
"""Draw multiple character (codepoint)"""
390+
...
388391
def DrawTextEx(font: Font,text: str,position: Vector2,fontSize: float,spacing: float,tint: Color,) -> None:
389392
"""Draw text using font and additional parameters"""
390393
...
@@ -466,6 +469,9 @@ def EndTextureMode() -> None:
466469
def EndVrStereoMode() -> None:
467470
"""End stereo rendering (requires VR simulator)"""
468471
...
472+
def ExportFontAsCode(font: Font,fileName: str,) -> bool:
473+
"""Export font as code file, returns true on success"""
474+
...
469475
def ExportImage(image: Image,fileName: str,) -> bool:
470476
"""Export image data to file, returns true on success"""
471477
...
@@ -613,6 +619,9 @@ def GenMeshTorus(radius: float,size: float,radSeg: int,sides: int,) -> Mesh:
613619
def GenTextureMipmaps(texture: Any,) -> None:
614620
"""Generate GPU mipmaps for a texture"""
615621
...
622+
def GetApplicationDirectory() -> str:
623+
"""Get the directory if the running application (uses static string)"""
624+
...
616625
def GetCameraMatrix(camera: Camera3D,) -> Matrix:
617626
"""Get camera transform matrix (view matrix)"""
618627
...
@@ -655,6 +664,9 @@ def GetFPS() -> int:
655664
def GetFileExtension(fileName: str,) -> str:
656665
"""Get pointer to extension for a filename string (includes dot: '.png')"""
657666
...
667+
def GetFileLength(fileName: str,) -> int:
668+
"""Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)"""
669+
...
658670
def GetFileModTime(fileName: str,) -> int:
659671
"""Get file modification time (last write time)"""
660672
...
@@ -827,6 +839,12 @@ def GetRayCollisionSphere(ray: Ray,center: Vector3,radius: float,) -> RayCollisi
827839
def GetRayCollisionTriangle(ray: Ray,p1: Vector3,p2: Vector3,p3: Vector3,) -> RayCollision:
828840
"""Get collision info between ray and triangle"""
829841
...
842+
def GetRenderHeight() -> int:
843+
"""Get current render height (it considers HiDPI)"""
844+
...
845+
def GetRenderWidth() -> int:
846+
"""Get current render width (it considers HiDPI)"""
847+
...
830848
def GetScreenHeight() -> int:
831849
"""Get current screen height"""
832850
...
@@ -1521,7 +1539,7 @@ def LoadFileData(fileName: str,bytesRead: Any,) -> str:
15211539
"""Load file data as byte array (read)"""
15221540
...
15231541
def LoadFileText(fileName: str,) -> str:
1524-
"""Load text data from file (read), returns a ' 0' terminated string"""
1542+
"""Load text data from file (read), returns a '\0' terminated string"""
15251543
...
15261544
def LoadFont(fileName: str,) -> Font:
15271545
"""Load font from file into GPU memory (VRAM)"""
@@ -1530,7 +1548,7 @@ def LoadFontData(fileData: str,dataSize: int,fontSize: int,fontChars: Any,glyphC
15301548
"""Load font data for further use"""
15311549
...
15321550
def LoadFontEx(fileName: str,fontSize: int,fontChars: Any,glyphCount: int,) -> Font:
1533-
"""Load font from file with extended parameters"""
1551+
"""Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set"""
15341552
...
15351553
def LoadFontFromImage(image: Image,key: Color,firstChar: int,) -> Font:
15361554
"""Load font from Image (XNA style)"""
@@ -1620,7 +1638,7 @@ def LoadWaveFromMemory(fileType: str,fileData: str,dataSize: int,) -> Wave:
16201638
"""Load wave from memory buffer, fileType refers to extension: i.e. '.wav'"""
16211639
...
16221640
def LoadWaveSamples(wave: Wave,) -> Any:
1623-
"""Load samples data from wave as a floats array"""
1641+
"""Load samples data from wave as a 32bit float data array"""
16241642
...
16251643
MATERIAL_MAP_ALBEDO: int
16261644
MATERIAL_MAP_BRDF: int
@@ -1922,7 +1940,7 @@ def SaveFileData(fileName: str,data: Any,bytesToWrite: int,) -> bool:
19221940
"""Save data to file from byte array (write), returns true on success"""
19231941
...
19241942
def SaveFileText(fileName: str,text: str,) -> bool:
1925-
"""Save text data to file (write), string must be ' 0' terminated, returns true on success"""
1943+
"""Save text data to file (write), string must be '\0' terminated, returns true on success"""
19261944
...
19271945
def SaveStorageValue(position: int,value: int,) -> bool:
19281946
"""Save integer value to storage file (to defined position), returns true on success"""
@@ -1933,6 +1951,9 @@ def SeekMusicStream(music: Music,position: float,) -> None:
19331951
def SetAudioStreamBufferSizeDefault(size: int,) -> None:
19341952
"""Default size for new audio streams"""
19351953
...
1954+
def SetAudioStreamPan(stream: AudioStream,pan: float,) -> None:
1955+
"""Set pan for audio stream (0.5 is centered)"""
1956+
...
19361957
def SetAudioStreamPitch(stream: AudioStream,pitch: float,) -> None:
19371958
"""Set pitch for audio stream (1.0 is base level)"""
19381959
...
@@ -1996,6 +2017,9 @@ def SetMousePosition(x: int,y: int,) -> None:
19962017
def SetMouseScale(scaleX: float,scaleY: float,) -> None:
19972018
"""Set mouse scaling"""
19982019
...
2020+
def SetMusicPan(music: Music,pan: float,) -> None:
2021+
"""Set pan for a music (0.5 is center)"""
2022+
...
19992023
def SetMusicPitch(music: Music,pitch: float,) -> None:
20002024
"""Set pitch for a music (1.0 is base level)"""
20012025
...
@@ -2044,6 +2068,9 @@ def SetShaderValueV(shader: Shader,locIndex: int,value: Any,uniformType: int,cou
20442068
def SetShapesTexture(texture: Texture,source: Rectangle,) -> None:
20452069
"""Set texture and rectangle to be used on shapes drawing"""
20462070
...
2071+
def SetSoundPan(sound: Sound,pan: float,) -> None:
2072+
"""Set pan for a sound (0.5 is center)"""
2073+
...
20472074
def SetSoundPitch(sound: Sound,pitch: float,) -> None:
20482075
"""Set pitch for a sound (1.0 is base level)"""
20492076
...
@@ -2074,14 +2101,17 @@ def SetWindowMinSize(width: int,height: int,) -> None:
20742101
def SetWindowMonitor(monitor: int,) -> None:
20752102
"""Set monitor for the current window (fullscreen mode)"""
20762103
...
2104+
def SetWindowOpacity(opacity: float,) -> None:
2105+
"""Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)"""
2106+
...
20772107
def SetWindowPosition(x: int,y: int,) -> None:
20782108
"""Set window position on screen (only PLATFORM_DESKTOP)"""
20792109
...
20802110
def SetWindowSize(width: int,height: int,) -> None:
20812111
"""Set window dimensions"""
20822112
...
20832113
def SetWindowState(flags: int,) -> None:
2084-
"""Set window configuration state using flags"""
2114+
"""Set window configuration state using flags (only PLATFORM_DESKTOP)"""
20852115
...
20862116
def SetWindowTitle(title: str,) -> None:
20872117
"""Set title for window (only PLATFORM_DESKTOP)"""
@@ -2154,7 +2184,7 @@ def TextJoin(textList: str,count: int,delimiter: str,) -> str:
21542184
"""Join text strings with delimiter"""
21552185
...
21562186
def TextLength(text: str,) -> int:
2157-
"""Get text length, checks for ' 0' ending"""
2187+
"""Get text length, checks for '\0' ending"""
21582188
...
21592189
def TextReplace(text: str,replace: str,by: str,) -> str:
21602190
"""Replace text string (WARNING: memory must be freed!)"""
@@ -2196,7 +2226,7 @@ def UnloadFileText(text: str,) -> None:
21962226
"""Unload file text data allocated by LoadFileText()"""
21972227
...
21982228
def UnloadFont(font: Font,) -> None:
2199-
"""Unload Font from GPU memory (VRAM)"""
2229+
"""Unload font from GPU memory (VRAM)"""
22002230
...
22012231
def UnloadFontData(chars: Any,glyphCount: int,) -> None:
22022232
"""Unload font chars info data (RAM)"""

raylib/physac.h.modified

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* DESCRIPTION:
66
*
77
* Physac is a small 2D physics engine written in pure C. The engine uses a fixed time-step thread loop
8-
* to simluate physics. A physics step contains the following phases: get collision information,
8+
* to simulate physics. A physics step contains the following phases: get collision information,
99
* apply dynamics, collision solving and position correction. It uses a very simple struct for physic
1010
* bodies with a position vector to be used in any 3D rendering API.
1111
*
@@ -50,7 +50,7 @@
5050
*
5151
* LICENSE: zlib/libpng
5252
*
53-
* Copyright (c) 2016-2021 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5)
53+
* Copyright (c) 2016-2022 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5)
5454
*
5555
* This software is provided "as-is", without any express or implied warranty. In no event
5656
* will the authors be held liable for any damages arising from the use of this software.
@@ -68,6 +68,8 @@
6868
* 3. This notice may not be removed or altered from any source distribution.
6969
*
7070
**********************************************************************************************/
71+
// Function specifiers in case library is build/used as a shared library (Windows)
72+
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
7173
// Allow custom memory allocators
7274
//----------------------------------------------------------------------------------
7375
// Defines and Macros

0 commit comments

Comments
 (0)