Not-Nik / raylib-zig

Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
MIT License
691 stars 122 forks source link

Added audio examples. Fix bug in raylib textFormat. #171

Closed ramonmeza closed 2 weeks ago

ramonmeza commented 2 weeks ago

Implemented raylib's (audio mixed processor example)[https://github.com/raysan5/raylib/blob/master/examples/audio/audio_mixed_processor.c].

I copied the audio files from raylib's repository and added them to this one under resources. Whenever someone gets around to implementing zig build examples, they will need to include that resources directory with the executable for this example to work properly.

Below is an image of the results of running zig build mixed_processor image

ramonmeza commented 2 weeks ago

I compared to the original example. I have much more distortion. I will iron out these issues.

ramonmeza commented 2 weeks ago

I figured out there was a bug in raylib.zig. textFormat was switching on .Struct, which was throwing an error. I looked at some of the innards and found @"struct" is an alias for Struct, so I switched on that instead.

ramonmeza commented 2 weeks ago

All of the audio examples have been added. Here's the list

zig build mixed_processor
zig build module_playing
zig build music_stream
zig build raw_stream
zig build sound_loading
zig build sound_multi
zig build stream_effects

The only issues I notice:

Not-Nik commented 2 weeks ago

This should be two PRs. One for the fix, one for the examples. Also take some time to read through CONTRIBUTING.md.

zig build examples is implemented, so any build steps should work with this PR (should as in, you should make them work if they don't).