Re: [AD] Problems with installing Allegro multiple times? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> > Anyone else have
> >thoughts on this?
>
> The bug looks to be with win_set_window.
I hope the attached patch fixes it. I'll contact the original poster and
ask for confirmation.
Evert
Index: src/win/wwnd.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/win/wwnd.c,v
retrieving revision 1.78
diff -u -r1.78 wwnd.c
--- src/win/wwnd.c 22 Mar 2004 13:25:23 -0000 1.78
+++ src/win/wwnd.c 27 Aug 2004 15:16:35 -0000
@@ -43,6 +43,8 @@
static int last_wnd_x = -1;
static int last_wnd_y = -1;
+static int window_is_initialized = FALSE;
+
/* graphics */
WIN_GFX_DRIVER *win_gfx_driver;
CRITICAL_SECTION gfx_crit_sect;
@@ -555,6 +557,8 @@
DeleteCriticalSection(&gfx_crit_sect);
input_exit();
+
+ window_is_initialized = FALSE;
}
@@ -638,7 +642,7 @@
static int (*saved_scbc)(void (*proc)(void)) = NULL;
struct WINDOW_MODULES wm;
- if (_allegro_count > 0) {
+ if (window_is_initialized) {
exit_window_modules(&wm);
exit_directx_window();
}
@@ -658,10 +662,12 @@
system_directx.set_close_button_callback = saved_scbc;
}
- if (_allegro_count > 0) {
+ if (window_is_initialized) {
init_directx_window();
init_window_modules(&wm);
}
+
+ window_is_initialized = TRUE;
}