Re: [AD] About al_get_current_display and al_show_native_message_box

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


On 2010-11-18, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> On 2010-11-17, David Capello <davidcapello@xxxxxxxxxx> wrote:
> > Hello,
> > 
> > One question, can we use "al_get_current_display" before calling "al_init"
> > or even if "al_init" fails? If we can, the following patch could be applied to
> > "examples/common.c" to avoid problems showing a message box
> > behinds the current display (e.g. in "ex_joystick_events.c" when we
> > don't have a joystick).
> 
> I don't think it's officially supported, yet.  It may initialise some
> thread-local state, which could be somewhat complicated.
> We could make tls_get() return NULL if Allegro hasn't yet been
> initialised, then all of the al_get_* functions for thread-local state
> will return default values.

Another alternative is to add al_is_system_installed.
This could be useful for other cases and arguably should be added
anyway for consistency.

Peter




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