![]() |
|
Allegro with resizable windows - ready for testing on MSVC |
Matt Smith
Member #783
November 2000
|
Attached is a version of Allegro which compiles in Visual Studio (7 or higher) and has a working GDI driver with resizable windows, with a small demo file. This will NOT build from the makefile because it's based on an 4.2 SVN checkout which had a broken file Instructions: You will now have a picture of mysha in a window. The window edges can be dragged, and the maximise button is now active. There is a refresh problem currently, which is probably due to the primitive callback in the demo, although I will look for internal reasons. The modified directx drivers are also in place but not yet working. This is based on Elias' version for X, which has been on the mailing list for some time, and has been tested quite hard. the principle is solid. I have added the global allegro_resizable_window_flag but this is only temporary, and not in the X version. TODO |
ImLeftFooted
Member #3,935
October 2003
![]() |
Hows it work, does it resize screen->w / screen->h and or SCREEN_W and SCREEN_H? |
Matt Smith
Member #783
November 2000
|
yep, both When you call resize_screen() then the old screen is destroyed and a new one made with the new dimensions. With this current setup it would be best to redraw immediately afterwards. The callback is supposed to be optional, but in the example is used to trigger resize_screen(). The minimum size params in set_resize_callback() are not currently honoured. |
Matthew Leverton
Supreme Loser
January 1999
![]() |
I haven't looked at it in detail, but the demo worked fine on Vista. It didn't update after moving to full screen until I restored the window (back to original size), and at that point it thought it was in full screen. But maybe that's what you meant by a refresh problem. The only other thing I noticed was the mouse resize icon didn't appear when the mouse was near the edge of the window. Edit: I guess you mentioned that too. Update: Is there a way to explicitly resize the window? I would expect it to work something like: void my_display_callback() { } al_allow_resize_flag = TRUE; // let the user resize, by default to any size // set_gfx_mode al_set_minmax_size(320,240, 1024,768); // user can resize from minimum of 320x240 to max of 1024x768 // OR // resize it myself. Doesn't require al_allow_resize to be set. // works with full screen as well. al_resize(640, 480);
|
Matt Smith
Member #783
November 2000
|
Quote: al_set_minmax_size(320,240, 1024,768); // user can resize from minimum of 320x240 to max of 1024x768 I considered adding 2 extra params to set_resize_callback() for max, but I've gone off that idea and a seperate func like yours would be better. I also think that the callback should be passed the new width & height, because threading issues might make SCREEN_W and SCREEN_H change during the callback Quote:
// resize it myself. Doesn't require al_allow_resize to be set. Great idea. noted and started. I think I'll do it as al_window_size(NULL, 640, 480); where the NULL is a dummy placeholder for an AL_DISPLAY* in 4.9 edit: btw the fullscreen behaviour you described is exactly what I have here. I think the driver needs an internal flag and resize_screen() should be called unconditionally every loop. more edit: Instead of a single global flag, should I move towards a 4.9 friendly approach and replace it with the following? al_window_setflags(NULL /*dummy AL_DISPLAY* again */, AL_DF_RESIZABLE);
|
|