Using raygui with raylib

Welcome to the forum @jiangbo!

I have moved this to a new topic, because it seemed only vaguely related to the original topic (both using raylib) and you maybe have a different problem.

Are you using raylib directly, or do you use the the binding Not-Nik/raylib-zig?

If you are using it directly you could try this:

The only thing I would try to change about this, is to use a second dependency on the raygui repository in the build.zig.zon instead of manually downloading the raygui header file.

This doesn’t use the raylib gui option, but just adds it directly in the cImport using the define, the problem with the raygui option (as far as I remember) is that it assumes a specific path where to find the raygui header and that doesn’t work well for all cases.

I guess in the future raylib could instead define raygui as an optional dependency and then it should work properly (without these shenanigans), but I think optional dependencies aren’t implemented yet.


If somebody tries / tests this, I would be happy to add this to the example repo as a raygui branch, or alternatively you could keep it in your own fork.

If you do, let me know and I will link to it in the readme, because it seems a bunch of people want this every few months.