PDA

View Full Version : Looking for leads on DirectDraw problem.


ErikH2000
12-19-2004, 05:04 PM
Well, it is crunch time again to release a game. Of course the game works fine on my development computer, but on one offsite tester's computer it is FUBAR. I send possible fixes to him, two hours later find out it doesn't work, send some more fixes, repeat repeat repeat. It's terribly inefficient and frustrating. I need some insight. Here is my problem...

I wrote DirectDraw 8 graphics code that works perfectly on my computer in both 640x480 and 800x600 modes. On the the problem configuration, 640x480 works fine, but in 800x600 fullscreen exclusive the screen will disappear (showing desktop with process is still running) as soon as you click anywhere on the screen. 800x600 windowed mode is also messed up but in a slightly different way--the window outline will show but the interior is completely empty as though all blits were invisible. In both windowed and fullscreen the process hasn't hung--it will still play music and respond to input.

For a test, I disabled all the mouse-handling code as well as game-specific code and I still have the problem. So after disabling code such that nothing but a black empty screen comes up, the problem is still there--clicking will send you back to desktop while the process continues to run.

A point I want to emphasize is that although the problem seems confined to 800x600 modes on this one computer, it is not like the configuration is lacking ability to operate in the requested video mode--the graphics will display correctly in 800x600 fullscreen.

Any leads or troubleshooting ideas you have would be much appreciated!

-Erik

oNyx
12-19-2004, 06:48 PM
Do the dx tests run properly? (win+r dxdiag)
Do other dx8 games work?
[bogus]Is the taskbar set to auto hide?

mkovacic
12-19-2004, 08:49 PM
I wrote DirectDraw 8 graphics code that works perfectly on my computer in both 640x480 and 800x600 modes. On the the problem configuration, 640x480 works fine, but in 800x600 fullscreen exclusive the screen will disappear (showing desktop with process is still running) as soon as you click anywhere on the screen.
We see the click-through problem all the time, it's fixed by fixed by some combo of calling SetForegroundWindow()/making your window top most before/after setting the fullscreen mode.

Unfortunately our current DX8 code does not have the fix (lost in the last refactor or something), our DX3 code has this (pseudo code):

SetForegroundWindow(HWND);
InitFullscreenMode();
SetWindowPos(HWND, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);

BTW, there's no DirectDraw8.

Ryan Clark
12-19-2004, 11:33 PM
A bit of a long shot, but I've seen this bite many people in the ass: Are you using any surfaces/textures that are larger than the screen resolution you're displaying at? Many video cards will barf if you attempt this.

Try loading all image data into system memory (instead of video memory) and re-test... if it still doesn't work, well, at least you've narrowed things down a bit :)

ErikH2000
12-20-2004, 11:19 AM
Well, it was Marin's advice that fixed the problem. Thanks, Marin, and also to Ryan and Onyx. I began the day with dread, thinking I would be working in this stupid code-send-test cycle all day, but hey, the first thing I tried fixed the problem. Murphy can't be right all the time!

I better shut up before I jinx myself, but I definitely am grateful for the good advice. This problem has been yet another example of the huge gulf between the spartan "example code" I copied from to get my routines working, and the production code which must be written for games to run on a large number of systems.

-Erik