longlene / cl-raylib

Common Lisp binding of raylib
MIT License
145 stars 21 forks source link

Support for `raygui` #27

Open bohonghuang opened 2 years ago

bohonghuang commented 2 years ago

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?

natefusion commented 2 years ago

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.

longlene commented 2 years ago

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

longlene commented 2 years ago

@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

bohonghuang commented 2 years ago

@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.

bplx commented 1 year ago

+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.

darthdeus commented 1 year ago

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?

bohonghuang commented 1 year ago

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.

longlene commented 1 year ago

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

longlene commented 1 year ago

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

bohonghuang commented 1 year ago

@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.

darthdeus commented 1 year ago

@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?

bohonghuang commented 1 year ago

@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.