[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] window resizing
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Sat, 18 Dec 2004 18:14:03 -0800
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=pA+OLFjef3QnhLwHWl8CIpgWEuiCeazZrC88Cz1DAhTuWSrysr01wPndnQn9j8Wh6/+rEqAgpNFrKsAEeBRAXQJcYP7aMl9JeCdvdHZ13s8rMla86fLtZrrR2rj0J3c4lr1ZhD3t42TusJvIzi4uiaQpHVWcdSdYGneGwga9YPA=
Evert Glebbeek wrote:
Very cool. The Window resizing function is a new entry in the gfx_vtable?
The way I would assume this works from a user perspective is that the user
registers a callback function that gets called when the screen is resized
(with the new (and possibly old) dimensions as parameter. I do think you
need to enable window resizing for it to work though (ie, the default is a
window that cannot be resized).
I'd imagine a set_resize_callback(...) function similar to
set_close_button_callback(...).
Right. What I think he's saying is that the user would set a callback
like you have described, but that function would be called from the
resize_window/resize_screen function. So, for example, it'd work like this:
int resize_screen(int w, int h)
{
if(_window_resize_callback && gfx_driver && gfx_driver->resize_window)
{
if(gfx_driver->resise_window(w, h))
{
_window_resize_callback(w, h);
return TRUE;
}
}
return FALSE;
}
Then when the message handler function receives a resize message, it
calls the resize_screen function.