Re: [AD] Keep the original screen

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


On 2004-07-01, Pedro Ruiz <bigplac@xxxxxxxxxx> wrote:
> Hello.
> I'm using allegro in linux framebuffer and I need to
> keep the original screen without changes.
> 
> The framebuffer screen is already initialized, so i
> want that my allegro app writes on it without setting
> it to blank and keep it when app finalizes 
> 
> can i do it?
> 
> if one change in allegro lib are need to work, what
> have I to change?

Yes, you would have to change the source of Allegro to make it work,
since there's no provision for environments where you already are
in graphic mode and want to grab the screen (Windows screensaver
people could jump on the bandwagon here).

The good news is that the change is not very drastic, and maybe
it could even work for people who have a "standard" allegro. First
you should modify src/linux/fbcon.c and remove all the lines which
erase the screen or somehow modify it. Note that while Allegro
always tries to *impose* a certain resolution, there's an internal
_safe_gfx_mode_change hack which already tries to avoid modifying
the screen size and depth. You could extend your modification to
as well avoid cleaning the screen, or maybe you could read that
from the allegro.cfg file with an get_config_int() call.

Finally, all that fbcon.c file is probably being compiled as a
dynamically loadable file. This means that you could tell the
user to replace the /usr/local/lib/allegro/version/alleg-fbcon.so
file with the one you provide, without having to modify the main
allegro library.

Another intereting file is src/unix/umodules.c, which shows that
modules are loaded in the order specified by the modules.lst file,
and there's an undocumented ALLEGRO_MODULES environment variable
which you could set to allow a specific user add his own custom
modules, so they wouldn't have to be root to use your modified
fbcon file with a standard allegro library.




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