Skip to content

Commit f9d52ed

Browse files
attempt fix booleans on windows build
1 parent 1b8598f commit f9d52ed

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed

examples/audio/resources/country.mp3

1.43 MB
Binary file not shown.

raylib/build.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ def build_unix():
169169

170170
def build_windows():
171171
print("BUILDING FOR WINDOWS")
172-
ffibuilder.cdef(open("raylib/raylib.h.modified").read())
173-
ffibuilder.cdef(open("raylib/rlgl.h.modified").read())
174-
ffibuilder.cdef(open("raylib/raygui.h.modified").read())
175-
ffibuilder.cdef(open("raylib/physac.h.modified").read())
172+
ffibuilder.cdef(open("raylib/raylib.h.modified").read().replace("bool", "int"))
173+
ffibuilder.cdef(open("raylib/rlgl.h.modified").read().replace("bool", "int"))
174+
ffibuilder.cdef(open("raylib/raygui.h.modified").read().replace("bool", "int"))
175+
ffibuilder.cdef(open("raylib/physac.h.modified").read().replace("bool", "int"))
176176
ffibuilder.set_source("raylib._raylib_cffi", """
177177
#include "raylib.h"
178178
#include "rlgl.h"

tests/test_gamepad.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pyray as pr
2+
pr.set_config_flags(pr.FLAG_MSAA_4X_HINT)
3+
pr.init_window(800, 600, 'Test gamepad')
4+
pr.set_target_fps(60)
5+
while not pr.window_should_close():
6+
pr.begin_drawing()
7+
pr.clear_background(pr.BLACK)
8+
if pr.is_gamepad_available(0):
9+
pr.draw_text(f'GP0: {pr.get_gamepad_name(0)}', 5, 5, 20, pr.RAYWHITE)
10+
pr.draw_text(f'Axis: {pr.get_gamepad_axis_count(0)}', 5, 30, 20, pr.RAYWHITE)
11+
pr.draw_text(f'Button: {pr.get_gamepad_button_pressed()}', 5, 55, 20, pr.RAYWHITE)
12+
_hy_anon_var_1 = pr.draw_text(
13+
f'Axis 0: {pr.get_gamepad_axis_movement(0, 0)}', 5, 85, 20, pr.RAYWHITE)
14+
else:
15+
_hy_anon_var_1 = None
16+
pr.end_drawing()
17+
pr.close_window()

tests/test_music.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pyray import *
2+
init_window(800, 450, "Hello")
3+
4+
init_audio_device()
5+
6+
music = load_music_stream("examples/audio/resources/country.mp3")
7+
music.looping = True
8+
play_music_stream(music);
9+
10+
11+
while not window_should_close():
12+
update_music_stream(music);
13+
begin_drawing()
14+
clear_background(WHITE)
15+
draw_text("music "+str(music.looping), 190, 200, 20, VIOLET)
16+
end_drawing()
17+
unload_music_stream(music)
18+
close_audio_device()
19+
close_window()

0 commit comments

Comments
 (0)