Skip to content

Commit 71f252b

Browse files
2.5.0post1 release
1 parent 93ca5da commit 71f252b

File tree

3 files changed

+55
-18
lines changed

3 files changed

+55
-18
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include raylib/static/*.so
22
include raylib/static/*.pyd
33
exclude raylib/static/*.a
4-
exclude raylib/static/*.h
4+
include raylib/*.h
55
exclude raylib/static/*.c
66
exclude raylib/static/*.o
77
include raylib/dynamic/*.dylib

README.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
1-
# Python Bindings for Raylib
1+
# Python Bindings for Raylib 2.5
22

3-
This uses CFFI API static bindings rather than ctypes. Hopefully this will be faster, the static type knowledge from the C
4-
headers will result in fewer bugs, and using the original headers will make it easier to maintain.
3+
New CFFI API static bindings. Faster, fewer bugs and easier to maintain than ctypes.
54

65
# Install
76

8-
**MacOS: Python 3.7**: we distribute a statically linked Raylib library, so in theory the only thing you need to do is install
9-
us from Pypi.
7+
**Windows 10 (64 bit): Python 3.6 - 3.7**
108

11-
pip3 install raylib
9+
**MacOS: Python 3.5 - 3.7**
1210

13-
**Linux: Python 3.6**: we dont distribute Raylib, so you must have Raylib 2.5dev already installed on your system. Currently we are building from the github version, specifically https://github.com/raysan5/raylib/commit/f325978b26ea934095f74ac628e6578ebbc2b7a0 although I guess any 2.5 build should work. First follow the instructions here: https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux Then do:
11+
We distribute a statically linked Raylib library, install from Pypi.
1412

1513
pip3 install raylib
16-
17-
**Windows 10 (64 bit): Python 3.7**: we distribute a statically linked Raylib library, thanks to https://github.com/Pebaz, so in theory the only thing you need to do is install us from Pypi.
18-
19-
pip3 install raylib
2014

21-
If you're using a different version of Python, or maybe a Linux/Mac with incompatible libraries
22-
you will have to build. The specific version we built against is https://github.com/raysan5/raylib/commit/f325978b26ea934095f74ac628e6578ebbc2b7a0 but we should soon try to synchronize with a proper released version of Raylib.
15+
If you're using **Linux** a different version of Python, or maybe a different version of Windows/Mac with incompatible libraries
16+
then you can either use the dynamic binding only or else you will have to build from source using Raylib 2.5, e.g.
2317

24-
cd raylib
18+
cd raylib/static
2519
python3 build_linux.py
26-
python3 build_mac.py
2720

2821
# Use
2922

@@ -32,9 +25,28 @@ you will have to build. The specific version we built against is https://github
3225
Currently the goal is make usage as similar to the original C as CFFI will allow. There are a few differences
3326
you can see in the examples. See test_static.py and examples/*.py for how to use.
3427

28+
```
29+
from raylib.static import *
30+
31+
InitWindow(800, 450, b"Hello Raylib")
32+
SetTargetFPS(60)
33+
34+
camera = ffi.new("struct Camera3D *", [[18.0, 16.0, 18.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0], 45.0, 0])
35+
SetCameraMode(camera[0], CAMERA_ORBITAL)
36+
37+
while not WindowShouldClose():
38+
UpdateCamera(camera)
39+
BeginDrawing()
40+
ClearBackground(RAYWHITE)
41+
DrawText(b"Hellow World", 190, 200, 20, VIOLET)
42+
EndDrawing()
43+
CloseWindow()
44+
45+
```
46+
3547
## raylib.dynamic
3648

37-
In addition to the API static bindings I have attempted to do CFFI ABI dynamic bindings in order to avoid the need to compile a C extension module.
49+
In addition to the API static bindings we have CFFI ABI dynamic bindings in order to avoid the need to compile a C extension module.
3850
There have been some weird failures with dynamic bindings and ctypes bindings before and often the failures are silent
3951
so you dont even know. Also the static bindings should be faster. Therefore I recommend the static ones...
4052

@@ -46,6 +58,28 @@ See test_dynamic.py for how to use them.
4658

4759
Wrapper around the static bindings. Makes the names snakecase and converts strings to bytes automatically. See test_pyray.py.
4860

61+
62+
```
63+
from raylib.static.pyray import pyray as prl
64+
from raylib.colors import *
65+
66+
prl.init_window(800, 450, "Hello Pyray")
67+
prl.set_target_fps(60)
68+
69+
camera = prl.Camera3D([18.0, 16.0, 18.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0], 45.0, 0)
70+
image = prl.load_image("examples/models/resources/heightmap.png")
71+
prl.set_camera_mode(camera, prl.CAMERA_ORBITAL)
72+
73+
while not prl.window_should_close():
74+
prl.update_camera(prl.pointer(camera))
75+
prl.begin_drawing()
76+
prl.clear_background(RAYWHITE)
77+
prl.draw_text("Hello world", 190, 200, 20, VIOLET)
78+
prl.end_drawing()
79+
prl.close_window()
80+
81+
```
82+
4983
## raylib.richlib
5084

5185
A very easy to use library on top of static bindings, modelled after Pygame Zero.
@@ -60,4 +94,5 @@ A very easy to use library on top of static bindings, modelled after Pygame Zero
6094

6195
* converting more examples from C to python
6296
* testing and building on more platforms
97+
* sorting out binary wheel distribution for Mac/Win and compile-from-source distributtion for Linux
6398

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# This call to setup() does all the work
1111
setup(
1212
name="raylib",
13-
version="2.5.0",
13+
version="2.5.0.post1",
1414
description="Python CFFI bindings for Raylib",
1515
long_description=README,
1616
long_description_content_type="text/markdown",
@@ -21,6 +21,8 @@
2121
classifiers=[
2222
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
2323
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3.5",
25+
"Programming Language :: Python :: 3.6",
2426
"Programming Language :: Python :: 3.7",
2527
],
2628
packages=["raylib", "raylib.dynamic", "raylib.static", "raylib.richlib"],

0 commit comments

Comments
 (0)