[AD] Resizable windows on Mac OS X

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


The attached patch implements resizable windows on MacOS X. The ex_resize2 demo works correctly with this patch, although the window goes blank while it is being resized. The backbuffer (see comment in ex_resize2) is resized correctly.

I do think that the way resizing currently works is different from how it is described in the documentation, but I also think it's consistent with X11 and Windows.

Some specific things Peter Hull may want to have a look at (if he has time):
There is a slightly odd line of code in osxgl.m, namely
[window setContentView: [window contentView]];
As it suggests, this gets the current view object from the window and sets it to be the current view object. Without this line I get artefacts and the view does not properly fill the window boudaries. I'm sure there's a better way to do this but everything else I tried didn't work properly.

I made a new ALOpenGLWindow class that derives from NSWindow in order to capture the windowWillResize message. Is this the proper way to do this sort of thing in Objective C, or is there a better way that doesn't require me to make my own derived class?

Also (Peter), if you prefer that I just commit things that seem to work for me and don't look too clunky, let me know.

Evert




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