diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 989b90b..7845059 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: python -m pip install --upgrade pip pip3 install cffi pip3 install wheel - python setup.py bdist_wheel --plat-name macosx_10_14_x86_64 --py-limited-api=cp37 + python setup.py bdist_wheel --plat-name macosx_10_15_x86_64 --py-limited-api=cp37 - name: Upload build Artifact wheel uses: actions/upload-artifact@v2.2.4 diff --git a/BUILDING.rst b/BUILDING.rst index 28cccde..42da839 100644 --- a/BUILDING.rst +++ b/BUILDING.rst @@ -9,9 +9,11 @@ This is useful if the binaries don’t work on your system, or you want to use a First make sure Raylib is installed. On Linux/Mac it must include the pkg-config files. Best way to ensure this is to compile and install Raylib using CMake: https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux#build-raylib-using-cmake +Requirements for build: cmake, pkg-config. + :: - cd raylib-4.0.0 + cd raylib-4.2.0 mkdir build cd build cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release .. @@ -113,7 +115,7 @@ Build and install Raylib from the raylib-c directory. :: - sudo apt install cmake libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev + sudo apt install cmake libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev pkg-config cmake cd raylib-python-cffi/raylib-c mkdir build cd build @@ -135,7 +137,7 @@ Build and install Raylib from the raylib-c directory. cd ../.. -Build +Build the Python library: :: @@ -217,8 +219,3 @@ Build and install module. python3 setup.py install - -Raspberry Pi -~~~~~~~~~~~~ - - diff --git a/README.md b/README.md index d146ecc..08a9299 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ On most platforms it should install a binary wheel (Windows 10 x64, MacOS 10.15 If yours isn't available then pip will attempt to build from source, in which case you will need to have Raylib development libs installed, e.g. using homebrew, apt, etc. -[If it doesn't work, you can build manually.](BUILDING.rst) +## Raspberry Pi [Using on Rasperry Pi](RPI.rst) @@ -49,13 +49,23 @@ There is now a separate dynamic version of this binding: python3 -m pip install raylib_dynamic -[Read this before using raylib_dynamic](https://electronstudio.github.io/raylib-python-cffi/dynamic.html) +It works on some systems where the static version doesn't, [but be sure to read these caveats before using it](https://electronstudio.github.io/raylib-python-cffi/dynamic.html) ## Beta testing +If you find a bug, it may be fixed in the [latest dev release](https://github.com/electronstudio/raylib-python-cffi/releases). You can install an alpha or beta version by specifying the exact version number like this: - python3 -m pip install raylib==4.0a6 + python3 -m pip install raylib==4.2.0.0.dev4 + +## Problems? + +If it doesn't work, [try to build manually.](BUILDING.rst). If that works then [submit an issue](https://github.com/electronstudio/raylib-python-cffi/issues) +to let us know what you did. + +If you need help you can try asking [on Discord](https://discord.gg/raylib). + +If it still doesn't work, [submit an issue](https://github.com/electronstudio/raylib-python-cffi/issues). # How to use diff --git a/dynamic/README.rst b/dynamic/README.rst index c1c46af..e2877bf 100644 --- a/dynamic/README.rst +++ b/dynamic/README.rst @@ -13,7 +13,7 @@ CFFI ABI dynamic bindings avoid the need to compile a C extension module. They Therefore I personally recommend the static ones. But the dynamic bindings have the advantage that you don't need to compile anything to install. You just need a Raylib DLL. -API is exactly the same as the static one documented here. (Therefore you can't have both modules installed at once.) The only difference is you can't do:: +The API is exactly the same as the static one documented here. (Therefore you can't have both modules installed at once.) The only difference is you can't do:: from raylib import * @@ -31,6 +31,9 @@ If you use the ``rl.`` prefix then code will work on both static and dynamic bin If you access functions via ``import pyray`` then there is no difference at all, but be warned this hasn't been tested much. +.. note:: + + Standard Raylib DLLs do not include additional libraries like Raygui, Physac, etc. So these functions won't work. .. important:: diff --git a/pyray/__init__.pyi b/pyray/__init__.pyi index 872547d..07eef4f 100644 --- a/pyray/__init__.pyi +++ b/pyray/__init__.pyi @@ -679,7 +679,10 @@ def get_mouse_ray(mousePosition: Vector2,camera: Camera3D,) -> Ray: """Get a ray trace from mouse position""" ... def get_mouse_wheel_move() -> float: - """Get mouse wheel movement Y""" + """Get mouse wheel movement for X or Y, whichever is larger""" + ... +def get_mouse_wheel_move_v() -> Vector2: + """Get mouse wheel movement for both X and Y""" ... def get_mouse_x() -> int: """Get mouse position X""" @@ -2426,6 +2429,11 @@ def wave_format(wave: Any,sampleRate: int,sampleSize: int,channels: int,) -> Non def window_should_close() -> bool: """Check if KEY_ESCAPE pressed or Close icon pressed""" ... +def wrap(float_0: float,float_1: float,float_2: float,) -> float: + """float Wrap(float, float, float); + +CFFI C function from raylib._raylib_cffi.lib""" + ... def rl_active_draw_buffers(int_0: int,) -> None: """void rlActiveDrawBuffers(int); @@ -2726,8 +2734,8 @@ def rl_get_framebuffer_width() -> int: CFFI C function from raylib._raylib_cffi.lib""" ... -def rl_get_gl_texture_formats(int_0: int,int_pointer_1: Any,int_pointer_2: Any,int_pointer_3: Any,) -> None: - """void rlGetGlTextureFormats(int, int *, int *, int *); +def rl_get_gl_texture_formats(int_0: int,unsignedint_pointer_1: Any,unsignedint_pointer_2: Any,unsignedint_pointer_3: Any,) -> None: + """void rlGetGlTextureFormats(int, unsigned int *, unsigned int *, unsigned int *); CFFI C function from raylib._raylib_cffi.lib""" ... @@ -3186,7 +3194,8 @@ class Color: self.a=a class FilePathList: """ struct """ - def __init__(self, count, paths): + def __init__(self, capacity, count, paths): + self.capacity=capacity self.count=count self.paths=paths class Font: diff --git a/raylib/__init__.pyi b/raylib/__init__.pyi index a66a822..04a237b 100644 --- a/raylib/__init__.pyi +++ b/raylib/__init__.pyi @@ -776,7 +776,10 @@ def GetMouseRay(mousePosition: Vector2,camera: Camera3D,) -> Ray: """Get a ray trace from mouse position""" ... def GetMouseWheelMove() -> float: - """Get mouse wheel movement Y""" + """Get mouse wheel movement for X or Y, whichever is larger""" + ... +def GetMouseWheelMoveV() -> Vector2: + """Get mouse wheel movement for both X and Y""" ... def GetMouseX() -> int: """Get mouse position X""" @@ -3151,6 +3154,11 @@ def WaveFormat(wave: Any,sampleRate: int,sampleSize: int,channels: int,) -> None def WindowShouldClose() -> bool: """Check if KEY_ESCAPE pressed or Close icon pressed""" ... +def Wrap(float_0: float,float_1: float,float_2: float,) -> float: + """float Wrap(float, float, float); + +CFFI C function from raylib._raylib_cffi.lib""" + ... def rlActiveDrawBuffers(int_0: int,) -> None: """void rlActiveDrawBuffers(int); @@ -3451,8 +3459,8 @@ def rlGetFramebufferWidth() -> int: CFFI C function from raylib._raylib_cffi.lib""" ... -def rlGetGlTextureFormats(int_0: int,int_pointer_1: Any,int_pointer_2: Any,int_pointer_3: Any,) -> None: - """void rlGetGlTextureFormats(int, int *, int *, int *); +def rlGetGlTextureFormats(int_0: int,unsignedint_pointer_1: Any,unsignedint_pointer_2: Any,unsignedint_pointer_3: Any,) -> None: + """void rlGetGlTextureFormats(int, unsigned int *, unsigned int *, unsigned int *); CFFI C function from raylib._raylib_cffi.lib""" ...