Re: [AD] _al_current_display

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


On Wed, 2008-08-13 at 22:27 +0100, Peter Hull wrote:
> I've submitted a patch to SF.net (it was too long and repetitive to
> put on the ML) What I've done is a lot of these:
> @@ -411,7 +413,9 @@
>   */
>  bool al_hide_mouse_cursor(void)
>  {
> -   return _al_current_display->vt->hide_cursor(_al_current_display);
> +   ALLEGRO_DISPLAY *current_display = al_get_current_display();
> +   ASSERT(current_display);
> +   return current_display->vt->hide_cursor(current_display);
>  }
> 
> Also can someone check my macro-fu on SCREEN_W/H? (I think this is a
> GNU extension)
> #ifdef __GNUC__
> #define SCREEN_W     (gfx_driver ? gfx_driver->w : ({ ALLEGRO_DISPLAY*
> c = al_get_current_display(); c ? c->w : 0;}))
> #define SCREEN_H     (gfx_driver ? gfx_driver->h : ({ ALLEGRO_DISPLAY*
> c = al_get_current_display(); c ? c->h : 0;}))
> #else
> #define SCREEN_W     (gfx_driver ? gfx_driver->w :
> al_get_current_display() ? al_get_current_display()->w : 0)
> #define SCREEN_H     (gfx_driver ? gfx_driver->h :
> al_get_current_display() ? al_get_current_display()->h : 0)
> #endif          /* ifdef __GNUC__ */
> 

Hm, didn't we decide to do away with the current A4 hacks, then later
build a simple and clean (and separate) A4 compatibility wrapper
completely on top of the public A5 API?

In which case, this would be a good time right now to just delete
SCREEN_W/H and anything depending on it :)

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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