Archived

This topic is now archived and is closed to further replies.

Zantac

D3D rendering problem

Recommended Posts

Hello! I''ve got a problem when rendering in direct3d. I''m using DrawIndexedPrimitiveVB without the D3DDP_WAIT flag. This means that the function returns immediately, and the polys are placed in a queue to be rendered. My game loop is faster than my card can render the frames, so because of this queue, a couple of frames will be pending rendering. This also means that any input (such as mouse movements or keyboard input) will not be shown until after a couple of frames, or, in my case as much as half a second later. This sucks, because it''s like playing with a huge amount of lag. My question is: is there any way to flush this queue, or check if the hardware is still rendering so i can wait for it to finish(or any other way to solve this problem)? I don''t want to use the D3DDP_WAIT flag, because then the card will only render in the render loop (i want it to work while i''m doing AI and physics and stuff so i can maximize performance). I''ve tried the GetFlipStatus(), to wait manually, but i couldn''t get it to work. (maybe i''m not doing it properly, or i shouldn''t use it at all... ? ) Please help! Thanks in advance, /Simon

Share this post


Link to post
Share on other sites
Hi again!

Thanks for the help... but it turns out that wasn''t the problem It seems the lag only appears when i''ve got antialiasing turned on (i''ve got a geforce2 mx).. the more FSAA, the more lag... however, the lag disappears if i draw the fps counter (using GDI TextOut() ).. (still FSAA turned on). I''m really confused !! Anyone had this problem before??

Please help (again )

Thanks,
Simon

Share this post


Link to post
Share on other sites
There is no official way to flush the queue. A D3D driver is only supposed to buffer 1.5 frames ahead, but most do more (it helps on 3D benchmarks.)

You can usually force a flush by locking the back buffer. GetDC() does do a lock, so your GDI printing is causing a flush.

Share this post


Link to post
Share on other sites