Advertisement

d3d7 flashing violently

Started by November 16, 1999 04:18 PM
7 comments, last by AlexM 25 years, 3 months ago
um, is nobody replying to this because nobody knows or it's a dumb question?
Well, I for one don't know... sorry!
Advertisement
Are you positive that you are using the DDBLT_WAIT flag both on the flip *and* on all the actual blits to your offscreen surface?

It sounds like the flip's working correctly, but that you're running into an error in the middle of your blits to the offscreen surface.

Try outputting some debugging information with the return code of the first blit after that blue clear you're doing. You'll probably find your problem there.

I hope this helps,
-E

------------------------
E.N.D. - http://listen.to/evil
If /\ that doesn't fix it then post some of the code (the flip() and the blt(), the call to clear()) I wouldn't mind having a look for the problem in it.
-ns
-ns-
i'm not blitting, i'm rendering. i know there's no problem with the flip, as it flashes in blue color (clearing color).

if (FAILED(this->lpd3ddev->Clear(1UL,&clRect,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,0x000000ff,1.0f,0)))
{
return false;
}

if (SUCCEEDED(this->lpd3ddev->BeginScene()))
{
this->lpd3ddev->DrawPrimitiveVB(D3DPT_TRIANGLELIST, lpd3dvb,0,
(numvertices*3),D3DDP_WAIT);
this->lpd3ddev->EndScene();
}
else
{
return false;
}

if (FAILED(lpddsPrimary->Flip(lpddsBack,DDFLIP_WAIT)))
{
return false;
}
thanks for the replies!
Alex.


If you send me your code (the entire code, not just the above sample) I'll take a look at it and see if I can find the problem.

A couple minor points: DO NOT CALL DRAWPRIMITIVE OR FLIP WITH THE WAIT FLAG!!!!

You eliminate parallelism when you do this.
Instead, wrap them like this:

do {
hr = DrawPrimitive();
} while(hr == DDERR_WASSTILLDRAWING);
if(FAILED(hr) . . .

Advertisement
You probably just didn't show it in your code for brevity, but you are checking the return code on your DrawPrimitive, right?

Also, when the function returns false, you are exiting, and not accidentally just falling though to the next loop, correct?

------------------------
E.N.D. - http://listen.to/evil
on my computer my d3d7 app runs fine, though it still flashes every 20 or so secs. i tried it on other computers, with different video cards, and it flashes violently, in blue color. which means the back surface is cleared, but not rendered on (i'm flipping). i figure the surface is busy (i'm passing the WAIT flag), but still gets cleared. I know i shouldn't be clearing, but is that the cause? just in case, some video cards i've tried:
my STB nVidia 8mb very few flashes
3D Blaster S4, 800, 640 - LOTS of flashes
32mb ATI All In Wonder Pro - Some flashes

thanks everyone!
the problem is that the surface is still busy and therefor it doesn't render, just clears. i just wasn't sure. the computers that show the most trouble are in fact more up to date than mine... yes, i like my computer

This topic is closed to new replies.

Advertisement