Skip to content

Commit ff8f9f7

Browse files
change bools to ints because windows compiler incorrectly says C bools are 1 byte when they should be 4
1 parent 9be6e97 commit ff8f9f7

File tree

6 files changed

+1619
-1623
lines changed

6 files changed

+1619
-1623
lines changed

raylib/raylib_modified.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ typedef struct Ray {
316316
} Ray;
317317

318318
// Raycast hit information
319+
319320
typedef struct RayHitInfo {
320321
bool hit; // Did the ray hit something?
321322
float distance; // Distance to nearest hit

raylib/static/_raylib_cffi.c

Lines changed: 1606 additions & 1622 deletions
Large diffs are not rendered by default.
-1.5 KB
Binary file not shown.
-1.5 KB
Binary file not shown.

raylib/static/build_win32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from cffi import FFI
44

55
ffibuilder = FFI()
6-
ffibuilder.cdef(open("../raylib_modified.h").read().replace('RLAPI ', ''))
6+
ffibuilder.cdef(open("../raylib_modified.h").read().replace('RLAPI ', '').replace('bool','int'))
77
ffibuilder.set_source("_raylib_cffi",
88
"""
99
#include "../raylib.h"

test_pyray.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
pyray.unload_image(image)
2121
pyray.set_camera_mode(camera, pyray.CAMERA_ORBITAL)
2222

23+
pos = pyray.get_mouse_position()
24+
ray = pyray.get_mouse_ray(pos, camera)
25+
rayhit = pyray.get_collision_ray_ground(ray, 0)
26+
print(str(rayhit.position.x))
27+
2328
while not pyray.window_should_close():
2429
pyray.update_camera(pyray.pointer(camera))
2530
pyray.begin_drawing()
@@ -30,4 +35,10 @@
3035
pyray.end_mode_3d()
3136
pyray.draw_text("This mesh should be textured", 190, 200, 20, VIOLET)
3237
pyray.end_drawing()
38+
39+
pos = pyray.get_mouse_position()
40+
ray = pyray.get_mouse_ray(pos, camera)
41+
rayhit = pyray.get_collision_ray_ground(ray, 0)
42+
print(str(rayhit.position.x))
43+
3344
pyray.close_window()

0 commit comments

Comments
 (0)