Re: [AD] _al_current_display |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2008-08-13, Peter Hull <peterhull90@xxxxxxxxxx> wrote:
>
> 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__ */
I suggest defining an inline function and making the macro call
that.
Peter