Original date:2022-09-15 13:26:58 Edited by: Icy_Viking Subject: Re: Allegro Wrapper?

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.

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu