cl-raylib icon indicating copy to clipboard operation
cl-raylib copied to clipboard

Support for `raygui`

Open bohonghuang opened this issue 2 years ago • 12 comments

raygui helps build immediate mode GUI with raylib. It's useful in writing debug interfaces and could become a good option for writing GUI in Common Lisp. Any plan to wrap it along with raylib?

bohonghuang avatar Jul 24 '22 06:07 bohonghuang

I actually tried to make raygui bindings myself a while ago, but I got stuck and kind of gave up. I posted the code at https://github.com/natefusion/cl-raygui if anybody wants to pick up where I left off.

natefusion avatar Jul 25 '22 03:07 natefusion

@BohongHuang @natefusion I'll have a try later, thank you!

longlene avatar Jul 25 '22 06:07 longlene

@BohongHuang raygui is a header only library and I think it's not delivered in the libraylib, may need to do some translation like effort

longlene avatar Jul 28 '22 06:07 longlene

@BohongHuang raygui is a header only library and I think it's not delivered in the libraylib, may need to do some translation like effort

Well, I got it. While raygui could be used as a standalone library, it usually works with raylib as a part of user code through #include in the C/C++ program. It may be necessary for the wrapper user to compile a dynamic linking library for raygui.

bohonghuang avatar Jul 29 '22 22:07 bohonghuang

+1 I'd love to see progress on this. I started using this recently and it's great! I can't help translate though, i'm still fairly new to lisp.

bplx avatar Nov 13 '22 02:11 bplx

Same! I'd love to play around with raygui, but being very new to CL it's hard to figure out how should the FFI stuff work. Feels like raylib & raygui is the absolute perfect match to CL's dynamic nature, and at least to me seems like the most straightforward way to write GUI apps in CL. Having looked at things like LTK and the Qt bindings it feels this is a much more obvious way in combination with CL's hot reloading.

Is there any meaningful way to contribute in getting this to work even though I don't know much about CL's FFI bindings?

darthdeus avatar Nov 18 '22 03:11 darthdeus

Same! I'd love to play around with raygui, but being very new to CL it's hard to figure out how should the FFI stuff work. Feels like raylib & raygui is the absolute perfect match to CL's dynamic nature, and at least to me seems like the most straightforward way to write GUI apps in CL. Having looked at things like LTK and the Qt bindings it feels this is a much more obvious way in combination with CL's hot reloading.

Is there any meaningful way to contribute in getting this to work even though I don't know much about CL's FFI bindings?

You may have a look at claylib, which uses cl-autowrap to generate bindings for raylib and raygui. But I'm still looking forward to any progress on this repository in terms of raygui.

bohonghuang avatar Nov 18 '22 04:11 bohonghuang

@bohonghuang @darthdeus @bplx Not sure if you guys are interested in this project: https://github.com/natefusion/cl-raygui

longlene avatar Nov 19 '22 01:11 longlene

I saw someone has done a project based on these 2 libraries https://github.com/bohonghuang/vgmplay

longlene avatar Nov 19 '22 01:11 longlene

@longlene It's an experimental project of mine to explore interactive GUI programming in CL. But there exists an issue in cffi causing some APIs in cl-raygui unusable, for which I forked cl-raygui and replaced bool with int to make them work.

bohonghuang avatar Nov 19 '22 04:11 bohonghuang

@longlene It's an experimental project of mine to explore interactive GUI programming in CL. But there exists an issue in cffi causing some APIs in cl-raygui unusable, for which I forked cl-raygui and replaced bool with int to make them work.

Hmm maybe I'm misunderstanding something, wouldn't this also affect all the bool params cl-raylib itself?

darthdeus avatar Nov 19 '22 13:11 darthdeus

@darthdeus To be precise, if you pass a C struct to raylib through cffi-libffi and expect a bool as the return value, you may get TYPE-ERROR, which is reported in issue 265 and 249 of cffi. cl-raygui use this kind of API quite a lot, while cl-raylib does not.

bohonghuang avatar Nov 19 '22 14:11 bohonghuang