Re: [AD] windows resizing regression

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


A patch is attached. The only problem I find after this is with ex_resize and opengl. That has been wrong for a long time though. I'm not sure of the cause.

Trent

On 07/11/2010 8:11 AM, Trent Gamblin wrote:
I seem to have fixed these two. ex_fs_resize appears to work here
though, but I made some changes that could help? I have yet to look
into the problem with speed.

Trent

On 07/11/2010 4:16 AM, Peter Wang wrote:
I found a number of regressions under Windows (XP).
I won't be releasing 5.0.0 RC1 today.

ex_resize and ex_resize2 behave strangely due to r13861 (Moving the
Windows event loops back into the same thread as the D3D event loop)

Can someone (Trent) look at this?

Peter
Index: src/win/wwindow.c
===================================================================
--- src/win/wwindow.c	(revision 13879)
+++ src/win/wwindow.c	(working copy)
@@ -879,9 +879,7 @@
 
          if (onoff) {
             ALLEGRO_MONITOR_INFO mi;
-            int adapter = al_get_new_display_adapter();
-            if (adapter == -1)
-               adapter = 0;
+            int adapter = win_display->adapter;
             al_get_monitor_info(adapter, &mi);
             display->flags |= ALLEGRO_FULLSCREEN_WINDOW;
             display->w = mi.x2 - mi.x1;
Index: src/win/wgl_disp.c
===================================================================
--- src/win/wgl_disp.c	(revision 13879)
+++ src/win/wgl_disp.c	(working copy)
@@ -1173,6 +1173,10 @@
       disp->w = mi.x2 - mi.x1;
       disp->h = mi.y2 - mi.y1;
    }
+   else {
+      win_disp->toggle_w = disp->w;
+      win_disp->toggle_h = disp->h;
+   }
 
    win_disp->window = _al_win_create_window(disp, disp->w, disp->h, disp->flags);
 
Index: src/win/d3d_disp.cpp
===================================================================
--- src/win/d3d_disp.cpp	(revision 13879)
+++ src/win/d3d_disp.cpp	(working copy)
@@ -1419,9 +1419,8 @@
    int window_x, window_y;
 };
 
-static void *d3d_create_window_proc(void *arg)
+static void d3d_create_window_proc(CREATE_WINDOW_INFO *info)
 {
-   CREATE_WINDOW_INFO *info = (CREATE_WINDOW_INFO *)arg;
    ALLEGRO_DISPLAY_WIN *win_display = (ALLEGRO_DISPLAY_WIN *)info->display;
    
    al_set_new_window_position(info->window_x, info->window_y);
@@ -1432,8 +1431,6 @@
       info->h,
       info->flags
    );
-   
-   return NULL;
 }
 
 static void *d3d_create_faux_fullscreen_window_proc(void *arg)
@@ -1627,10 +1624,12 @@
    while (!win_display->end_thread) {
       al_rest(0.001);
 
-      if (GetMessage(&msg, NULL, 0, 0) != 0)
-         DispatchMessage(&msg);
-      else
-         break;                  /* WM_QUIT received or error (GetMessage returned -1)  */
+      if (PeekMessage(&msg, NULL, 0, 0, FALSE)) {
+         if (GetMessage(&msg, NULL, 0, 0) != 0)
+            DispatchMessage(&msg);
+         else
+            break;                  /* WM_QUIT received or error (GetMessage returned -1)  */
+      }
 
       if (!d3d_display->device) {
          continue;
@@ -1760,13 +1759,13 @@
             al_get_monitor_info(adapter, &mi);
             al_display->w = mi.x2 - mi.x1;
             al_display->h = mi.y2 - mi.y1;
-            win_display->toggle_w = w;
-            win_display->toggle_h = h;
             d3d_display->faux_fullscreen = true;
          }
          else {
             d3d_display->faux_fullscreen = false;
          }
+         win_display->toggle_w = w;
+         win_display->toggle_h = h;
       }
 #ifdef ALLEGRO_CFG_D3D9EX
    }
@@ -2218,14 +2217,13 @@
    bool ret;
    int full_w, full_h;
    ALLEGRO_MONITOR_INFO mi;
-   int adapter = al_get_new_display_adapter();
+   int adapter = win_display->adapter;
    int orig_w, orig_h;
+   ALLEGRO_STATE backup;
 
    orig_w = d->w;
    orig_h = d->h;
 
-   if (adapter == -1)
-         adapter = 0;
    al_get_monitor_info(adapter, &mi);
    full_w = mi.x2 - mi.x1;
    full_h = mi.y2 - mi.y1;
@@ -2289,7 +2287,6 @@
        * The clipping rectangle and bitmap size must be
        * changed to match the new size.
        */
-       /*
       al_store_state(&backup, ALLEGRO_STATE_TARGET_BITMAP);
       al_set_target_bitmap(&disp->backbuffer_bmp.bitmap);
       disp->backbuffer_bmp.bitmap.w = width;
@@ -2297,7 +2294,6 @@
       al_set_clipping_rectangle(0, 0, width, height);
       _al_d3d_set_bitmap_clip(&disp->backbuffer_bmp.bitmap);
       al_restore_state(&backup);
-      */
 
       ret = true;
    }


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