Green Screen Problem

Started by
4 comments, last by njpaul 18 years, 11 months ago
I remember seeing this posted before, but after searching the forums for an hour I gave up, so I'm posing this question again. I'm using the newest version of Direct3D. Everything in the program runs fine, but when it exits the screen flashes green for a second. Trying to use the print screen to take a screenshots also results in this green screen. Anybody have an idea about fixing it?
Advertisement
The screenshot turning up incorrect is because you haven't set your backbuffer to be lockable (put D3DPRESENTFLAG_LOCKABLE_BACKBUFFER in the Flags of your D3DPRESENT_PARAMETERS structure). As for why it is green, that's related to your other problem:

The flashing green when your program shuts down is most likely because you're using D3DSWAPEFFECT_DISCARD, running on the Debug runtime and have one Present call that happens at the end of your program without any drawing operations. The debug runtime causes the backbuffer to be filled with green and magenta (alternating each frame) when using discard. On the release runtime, this doesn't happen.
Kippesoep
How do I get it to use the release runtime? Changing to the copy swap effect works, but it worries me a bit that I'm using the debug runtime. The lockable backbuffer flag worked for the screenshot problem as well. Thanks.
Nevermind, I found it hiding in control panel. I looked there once before and it said I was in the retail version. It wasn't until I tabbed to the Direct3D section that I saw it was indeed in debug. Everything works fine now. Strange though, that this didn't happen with my other applications running under debug mode.
WHen developing, it's best to use the Debug runtime. This will allow you to get error and warning messages in your debugger's console, which in turn enables you to fix problems that might not show in release mode on your system.
(Errors may not show up as errors when in release mode, but they might also blue-screen the entire system. It depends on the kind of error as well as your card and driver version). The warning messages may also give you hints in optimising your program.
Kippesoep
Yeah, I've relied a lot of the debugger, and many a time I've had to do a restart. Problem is that if an error occurs in a fullscreen application sometimes you can't tab out of it to get to the debugger. I guess this is a good reason to set your window to a smaller size while testing, although I'd rather put it on another monitor if I had the money to buy one.

This topic is closed to new replies.

Advertisement