Re: [AD] Window Resizing

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


I thought of another idea.. What if the BITMAP
struct's values themselves where reallocated.  There
could be a function
int resize_bitmap(BITMAP *bmp, int w, int h);
Returning non-zero if there isn't enough memory.

It would simply go inside the bmp and reallocate the
line pointer and change the bitmaps w/h values.

This would be a lot cleaner all around I think and
allow the screen variable to never actually change.

Another note: hooking to release_screen might be a bad
idea now that i think about it, it would be cleaner to
recieve the events even if there are no screen locks.

But, wouldnt it work to make aquire_screen /
release_screen (or actually aquire_bitmap(screen)
since afaik aquire_screen is just a wrapper for this)
a mutex like system, and have the resizing thread wait
for the mutex (release_screen) to be unlocked, then
lock it until proc returns and the screen is resized
using resize_bitmap.  aquire_screen would presumably
have to wait for the mutex to unlock.




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