Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for raygui #27

Open
bohonghuang opened this issue Jul 24, 2022 · 12 comments
Open

Support for raygui #27

bohonghuang opened this issue Jul 24, 2022 · 12 comments

Comments

@bohonghuang
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Owner

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

@longlene
Copy link
Owner

@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
Copy link
Contributor Author

bohonghuang commented Jul 29, 2022

@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
Copy link

bplx commented Nov 13, 2022

+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
Copy link

darthdeus commented Nov 18, 2022

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
Copy link
Contributor Author

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
Copy link
Owner

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

@longlene
Copy link
Owner

longlene commented Nov 19, 2022

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

@bohonghuang
Copy link
Contributor Author

@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
Copy link

@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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants