@@ -47,41 +47,43 @@ CloseWindow()
4747
4848```
4949
50- ## raylib.dynamic
50+ ## raylib.pyray
5151
52- 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.
53- There have been some weird failures with dynamic bindings and ctypes bindings before and often the failures are silent
54- so you dont even know. Also the static bindings should be faster. Therefore I recommend the static ones...
52+ Wrapper around the static bindings. Makes the names snakecase and converts strings to bytes automatically. See test_pyray.py.
5553
56- BUT the dynamic bindings have the big advantage that you don't need to compile anything to install. You just need a Raylib DLL,
57- which we supply for Windows/Mac/Linux.
5854
59- See test_dynamic.py for how to use.
55+ ```
56+ from raylib.pyray import PyRay
57+ from raylib.colors import *
6058
61- ## raylib.static. pyray
59+ pyray = PyRay()
6260
63- Wrapper around the static bindings. Makes the names snakecase and converts strings to bytes automatically. See test_pyray.py.
61+ pyray.init_window(800, 450, "Hello Pyray")
62+ pyray.set_target_fps(60)
6463
64+ camera = pyray.Camera3D([18.0, 16.0, 18.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0], 45.0, 0)
65+ pyray.set_camera_mode(camera, pyray.CAMERA_ORBITAL)
66+
67+ while not pyray.window_should_close():
68+ pyray.update_camera(pyray.pointer(camera))
69+ pyray.begin_drawing()
70+ pyray.clear_background(RAYWHITE)
71+ pyray.draw_text("Hello world", 190, 200, 20, VIOLET)
72+ pyray.end_drawing()
73+ pyray.close_window()
6574
6675```
67- from raylib.static.pyray import pyray as prl
68- from raylib.colors import *
6976
70- prl.init_window(800, 450, "Hello Pyray")
71- prl.set_target_fps(60)
77+ ## raylib.dynamic
7278
73- camera = prl.Camera3D([18.0, 16.0, 18.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0], 45.0, 0)
74- prl.set_camera_mode(camera, prl.CAMERA_ORBITAL)
79+ 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.
80+ There have been some weird failures with dynamic bindings and ctypes bindings before and often the failures are silent
81+ so you dont even know. Also the static bindings should be faster. Therefore I recommend the static ones...
7582
76- while not prl.window_should_close():
77- prl.update_camera(prl.pointer(camera))
78- prl.begin_drawing()
79- prl.clear_background(RAYWHITE)
80- prl.draw_text("Hello world", 190, 200, 20, VIOLET)
81- prl.end_drawing()
82- prl.close_window()
83+ BUT the dynamic bindings have the big advantage that you don't need to compile anything to install. You just need a Raylib DLL,
84+ which we supply for Windows/Mac/Linux.
8385
84- ```
86+ See test_dynamic.py for how to use.
8587
8688## raylib.richlib
8789
@@ -98,4 +100,5 @@ A very easy to use library on top of static bindings, modelled after Pygame Zero
98100 * converting more examples from C to python
99101 * testing and building on more platforms
100102 * sorting out binary wheel distribution for Mac/Win and compile-from-source distributtion for Linux
103+ * dealing with conversions to pointers in PyRay automatically
101104
0 commit comments