Re: [AD] window resizing

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


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.





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