Re: [AD] window resizing

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


Elias Pschernig wrote:

On Sun, 2004-12-19 at 15:25 -0500, Jon Rafkind wrote:
You mean

void (*resize_handler)( int w, int h, void * data );

Sorry, didn't quite follow this thread (but I will read it all in a few
days) - but why the w and h? Isn't the allegro way to use SCREEN_W and
SCREEN_H to get w and h, so no need to pass it around?

I think SCREEN_W and SCREEN_H would need to be deprecated with the callback-based design, otherwise you would get inconsistent results in the following case:

   int w = SCREEN_W;
   /* context switch here; window resized */
   int h = SCREEN_H;

You'd probably need a function like get_screen_dimensions(int *width, int *height), which would lock out the resize operation for its duration. Even so, that the resize can change the screen variable *at any time* makes me uncomfortable.

Peter




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