[AD] RLE sprites and AllegroGL

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


The Allegro driver in AllegroGL is currently under developement. As a reminder, the "Allegro driver" of AGL is intended to allow the user to use Allegro's gfx functions over an OpenGL background : AGL then translates each Allegro gfx requests into GL commands (and eventually does some magic ^_^ ) in order to obtain the desired result.

Most of the methods of the GFX_VTABLE have been implemented so far but some of them still need to be written. I am currently developing the method to draw a RLE sprite onto the screen and I think that the RLE struct lacks an "extra" pointer. The point is that whereas the BITMAP struct provides a so-called "extra" pointer to implement, well... , extra functionalities, the RLE struct lacks such an option. From an AllegroGL point of view, since a RLE sprite can not be modified but can just (quoting the docs) be blasted onto a bitmap, it is a good candidate for being cached into texture memory. However, in order to do that, we need to keep track of some datas (including the texture ID that would contain the RLE sprite) and the best place to store such datas is the RLE struct itself. Hence the need for an "extra" pointer.

In order to mimic the BITMAP design, the patch also adds a method "destroy_rle_sprite" to the SYSTEM_DRIVER struct. The purpose is of course to allow extra datas to be correctly deleted by Allegro and (again from an AGL point of view) to provide a way to release its corresponding texture space when it is no longer needed.

I am aware that, since it breaks the ABI, the patch can not be added to the 4.0.x branch but I would appreciate that you consider its inclusion into the 4.1.x branch. Notice however that this patch is not that important for the AGL developement to continue but if you commit it, it will allow a major speed improvement for RLE sprites in AGL including for low-end graphics card (and is not speed improvement a major advantage of RLE sprites ? ^_^).

By the way, it has been a while since the last time I built a CVS version of Allegro and (shame on me) I could not remind how to build Allegro from CVS scratch. I have to admit moreover that it took me a while in order to discover that installation docs are now hidden in docs/build. May be I am dumb ^_^ but I guess I am not the only one (or am I ? ^_^) so may I suggest you to add the well-known "install" file at the Allegro root directory ? It could contain something like "Bad luck dude! Try docs/build instead", well... you get the point.

That's all ^_^.

   Bertrand.

Attachment: rle_extra.diff.gz
Description: application/gzip



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/