Re: Allegro Wrapper?

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...
Icy_Viking said...

Hello all,

So recently after looking through the updated documentation of Allegro, I have thought about making an Allegro wrapper. Now I know I did in the past, but its old and the codebase is just ugh. So I would rather start new with the most recent version of Allegro. Just wondering if anyone would use it or have use for it?

Codebase wise it would be similar to how the C version is. Each would have its own .e include file. For example: base.h would base.e and would contain the Euphoria code equvialent for wrapping DLLs.

As I recall, Allegro has the same problem as Raylib: it passes a lot of structures by value instead of by reference, e.g. al_map_rgb() returns an ALLEGRO_COLOR struct which is four floats.

Euphoria currently isn't equipped to pull that off the stack, but it can be. I think we need to work on solving this first instead of relying on hacks or shim libraries.

Most of my time recently has been spent pouring through the source code and picking at things to see how they work.

I will see if I can graft in libffi to replace the existing routines. That should allow a lot more flexibility, broader compatibility, and less work to understand calling conventions, etc.

Another thing we need is a better approach to wrapping C libraries. I've recently revisited IUP and I think I've got a good foundation sketched out for general-purpose C-to-Euphoria wrapping process.


Well maybe I'll wait then. Having a libffi in Euphoria would benefit greatly in wrapping C libraries. As would having struct support. A better solution to wrapping libraries sounds great instead of what we currently have. Granted though that Allegro is pretty C-ish and wouldn't be too hard to wrap, except for some routines. But if a better solution is on the horizon, then that sounds great.

Speaking of IUP, I was looking at GUI/Widget toolkits the other day. I was heavily looking at enlightenment/EFL. I develop on Windows and EFL is mainly Linux based, though it is possible to build on Windows according to its documentation. I have yet to sucessfully build it on Windows, but with Windows 10/11 having the Linux Subsystem and Windows 10/11 being even more friendly for programmers (Windows 11 lets you run linux graphical programs, but I'm on Win 10 and my hardware doesn't support 11. Granted there are work-arounds for running graphical Linux apps on Win 10 in the Linux Subsystem), it is becoming easier to develop on. I really think if I or someone else can get EFL to build on Windows, I could start working on a wrapper for Eu, it is very C-ish and looks like it would be fairly straight-forward to wrap. I also took a look at the GTK port of Windows, its a little behind the Linux version, but not by much. Though I don't think there would be much use for a GTK wrapper on Windows.

I did try wrapping FCTLK(or whatever its called), using the C port. Due to bad documentation though, it ended up being abandoned. I might go back and revisit it, but chances of that are slim. I really think Greg has some good ideas, adding libffi support, struct support and a better way to wrap C libraries in Eu. It might (key-word might) even be possible to wrap C-Plus-Plus libs in Eu with the updated tools when they become available. I saw Greg wrapped libUI for Eu, but that is for minimal GUI programs. An updated win32lib wouldn't be bad with support for Win 10/11 and such. WxWidgets could be another solution, QT seems to be ahead of wxWidgets at this point, but it would probably be a pain to wrap QT for Eu, also, its CPlusPlus.

I also did a wrapper for IUP, but its based on an old version.

new topic     » goto parent     » topic index » view thread      » older message » newer message


Quick Links

User menu

Not signed in.

Misc Menu