Archived

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

NightZero

ddutil slow?

Recommended Posts

Hi! I have some more information now, so I try again, sorry! :-) My 2D game is _much_ slower since I installed Win XP. I used win 2000 before. I use this function to control my game loop: DWORD dwStart = timeGetTime(); MainLoop(); while ((timeGetTime() - dwStart) < 20); When I used win 2000 It run fast and the game loop took below 20 ms. Now when I use win XP, the loop takes between 90 and 100 ms (used OutputDebugString to print the dwStart value). This is probably the reason it is slow... But why is it slower under win XP??? During debugging I found the plase where it takes time. It''s the Present()-method in ddutil class in this place: if( m_bWindowed ) hr = m_pddsFrontBuffer->Blt( &m_rcWindow, m_pddsBackBuffer, NULL, DDBLT_WAIT, NULL ); I can play for example Unreal Tournament without any problems (it goes fast), so it has to be my program. What could be wrong?? Are there different ways to use the graphics memory? I use direct draw with the helper classes shipped with DXSDK 8.1. ddutil, dxutil. My graphics card is an old S3 Savage4 16 Mb. I tried DX9, but it did not get better. Regards, Mattias

Share this post


Link to post
Share on other sites
It may likely be your presentation parameters
in the D3DPRESENT_PARAMETERS object you use when
creating your d3d device.

Its probably currently D3DPRESENT_INTERVAL_DEFAULT.
Change it to: D3DPRESENT_PARAMTERS.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;

It just means that instead of waiting for a virtual
retrace of your screen; you will immedately dump the
back buffer to the front buffer. Since you might be
page flipping multiple times in one retrace it could
cause flicker, if this is what it is.

Good luck.

Share this post


Link to post
Share on other sites
Ok, thanks... but I don''t use d3d... I use directdraw in DXSDK 8.1... I mean I don''t thing I use it :-) Cant find it in ddutil.cpp that comes with DXSDK 8.1.

/Mattias

Share this post


Link to post
Share on other sites
I don''t have much experience with directDraw.
I thought it was integrated into Direct3d past
DirectX 8, but I assume the problem is the
same.

If your Present is slow, the only reason I
would assume is because it is waiting for
sycnrhonization.

Please post when you fix it, I''m really curious
what is causing the slowdown if its not the
presentation rate.

Share this post


Link to post
Share on other sites