Re: [AD] Resize hooks patch

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



Angelo Mottola wrote:
> 
> > ...has been sent to sourceforge. It adds resize hooks to Windows and
> > X-11. (X-11 untested).
> 
> Humm, I got this just when I finished my own version of the thing...

I don't see why anyone would need multiple callbacks. Can you give an
example?
Other than that, I think it's ok.
My patch on the other hand makes changes to the window managers so the
hooks actually get called. This works fine in AllegroGL, howevery, my
example forgram (stretches mysha.pcx on the window) doesn't. It gets the
correct width and height, but the display is still clipped on the
original bounderies. It's prolly an issue with DirectX, but I have no
idea how to code for it, so I'm not sure I can fix it.

I modify the SCREEN_W and SCREEN_H accordingly.
I'll send my updated patch.


> I post mine here, so you can take a look at it: my code allows to set up to 8
> callbacks for both closing and resizing events, and the ports only need to
> call _handle_window_close() or _handle_window_resize(w, h). These will call
> the callbacks (if any), and the first will also call allegro_exit() before
> exiting.

I think we should let the closing up to the program. Perhaps call
allegro_exit() if there are no callbacks installed, that way, we don't
break things too much :)

> 
> > Someone will have to take on BeOS and Mac support though (it's as simple
> > as adding 3 lines to the window manager code - see patch for details).
> 
> I can work on the Be code, and X too; Michael, I received your code, and
> it'll be very useful, thanks!
> 
> > It doesn't enable resizing, just adds the hooks.
> 
> Same as me =)

Ok, my patch now enables resizing in Windows. No luck in getting it to
work though.

Oh yeah, in Windows, Allegro creates the window inside allegro_init().
That means that the resize flag must be enabled before allegro_init,
which doesn't really make sense.
Anyway, here's the patch and example program.


--
- Robert J Ohannessian

Attachment: window_resize2.diff
Description: application/unknown-content-type-difffile

Attachment: exresize.c
Description: application/unknown-content-type-cfile



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