|
SWITCH_BACKGROUND hangs |
locksleyu
Member #7,742
September 2006
|
My application, which is normally very stable, tends to hang when not the active window whenever I run with set_display_switch_mode(SWITCH_BACKGROUND). I am calling acquire_screen() and release_screen() before and after any writes to the screen, but this doesn't seem to help. I'm using Allegro 4.2.0 under Windows 2000 professional and Visual Studio 2005. Can anyone get SWITCH_BACKGROUND to work? ARTSG: Real-Time Strategy game: http://artsg.pbwiki.com/ |
gnolam
Member #2,030
March 2002
|
Quote: I am calling acquire_screen() and release_screen() before and after any writes to the screen, but this doesn't seem to help. You're not doing anything else except blitting operations to the screen between those calls are you? -- |
locksleyu
Member #7,742
September 2006
|
I am only doing circle(), line(), rect() and draw_sprite() between the acquire and the release. I am using double buffering so I do most of the normal drawing to my active page, and then I call draw_sprite(screen, active_page, ..) ARTSG: Real-Time Strategy game: http://artsg.pbwiki.com/ |
Neil Walker
Member #210
April 2000
|
I take it you know switch_background doesn't actually work in windows fullscreen mode? Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
locksleyu
Member #7,742
September 2006
|
I'm running in windowed mode with videomode GFX_GDI. SWITCH_BACKGROUND works in this mode, right? ARTSG: Real-Time Strategy game: http://artsg.pbwiki.com/ |
Neil Walker
Member #210
April 2000
|
I can only imagine so, but you should always test the return value. In my code I allow swapping between windowed/fullscreen and various other modes so I simply code for the bare minimum that should work for windows and other o/s's, as in:
Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Evert
Member #794
November 2000
|
Quote: set_display_switch_mode(SWITCH_BACKGROUND)
You did remember to checkthereturn value, right? Quote: SWITCH_BACKGROUND works in this mode, right? I wouldn't know, but why don't you check the return value and find out? |
locksleyu
Member #7,742
September 2006
|
I changed my video mode from GFX_GDI to GFX_DIRECTX_WIN and the hangs have stopped. By the way, the call to set_display_switch_mode(SWITCH_BACKGROUND) was returning 0. Thanks for the help everyone! ARTSG: Real-Time Strategy game: http://artsg.pbwiki.com/ |
Evert
Member #794
November 2000
|
Quote: I changed my video mode from GFX_GDI to GFX_DIRECTX_WIN and the hangs have stopped. Any particular reason you're not using GFX_AUTODETECT_WINDOWED? If not, you should use that instead of any other driver. |
|