Skip to main content
GameDev.net gamedev.net
🔒 Locked

Fullscreen problems

Started by Harryu Oct 24, 2007 at 7:26 AM 3 replies 1.6k views
Original Post
Harryu
Harryu
Hi, I have a loading screen for my game, where I initially render a faded-out sprite, and then, as the game loads, I render more and more of the full colour sprite. So I have: Clear screen (white) Render faded image Load some stuff Render 10% of coloured image over the top Load some more Render 20% of coloured image ... You get the idea Each time I render more of the coloured picture, I do the BeginScene and Begin (for the sprite) (but never clearing the screen). Now, this works perfectly in windowed mode (setting the window flag in the present_parameters structure to true), but when I use fullscreen (setting 'window' to false), on alternate 'colouring steps' (i.e. 20%, 40%, 60% - or 10%, 30% - I'm not sure which one) the background (usually white) turns black, along with the faded out image (or at least, whatever remains visible). Any ideas? Thanks in advance, Harry
jollyjeffers
jollyjeffers
Sounds like you're doing something wrong for fullscreen - what do the debug runtimes say? Are you checking all of your HRESULT's and performing all appropriate enumeration?

I highly doubt this has anything to do with the effect you're implementing - once you've got a device up and running the actual rendering operations don't really know nor care whether it's windowed or fullscreen.

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
Harryu
Harryu
I use D3DSWAPEFFECT_FLIP for fullscreen, ...DISCARD for windowed.
Namethatnobodyelsetook
Namethatnobodyelsetook
And there's the bug... or two of them.

DISCARD is you promising you won't use the contents after doing a present. This lets the driver trash the memory however it wants. It's often just fine unless you use AA. If you used the debug runtimes it would wipe the surface green and purple to help you remember not to rely on the contents of the surface. I'd turn it on, just to see what else it catches you doing wrong.

FLIP says there are two buffers, a front and back buffer. When you present, you flip between them. You clear your backbuffer surface to white, and draw on the backbuffer. At this point, the front buffer is empty (black, or initialized with random goo, whichever). You present. The front buffer is now the surface with your white background and image, and the backbuffer contains now contains the old front buffer... black or garbage. As you're just drawing more of your image, not clearing the backbuffer, this surface never gets a white background. Just your image on black (or garbage).

The behaviour you seem to be expecting is what SWAPEFFECT_COPY does, ie: copy the backbuffer to the front buffer. This leaves the old contents of the backbuffer present for you to update.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.