Archived

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

lookx2

Problem with Direct3D system flow

Recommended Posts

lookx2    122
I''ve write a Direct3D program ~ i''ve Create a square with texture, but something strange happen, whatever what i draw at the screen, the framerate cannot greater than 75, even i only draw a trangle at the center of the screen, the max framerate is 75, i''ve try many other computer, the result is the same,even i use ATI 9700.. I wonder is my system flow have problem or the way to calculate FPS is incorrect? The Calculation of FPS is : VOID UpdateDisplay() { FLOAT fTimeLapsed = DXUtil_Timer( TIMER_GETAPPTIME ) - fLastTime; fpsCal += fTimeLapsed; nof ++; if( fTimeLapsed <= 0.01f ) fTimeLapsed = 0.01f; fLastTime = DXUtil_Timer( TIMER_GETAPPTIME ); if( fpsCal >= 1.0f) { fps = nof/fpsCal; fpsCal = 0.0f; nof = 0.0f; } } And the system flow is(at winmain): while( msg.message != WM_QUIT ) { if( g_bIsActive ) bGotMsg = PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ); else bGotMsg = GetMessage( &msg, NULL, 0U, 0U ); if( bGotMsg ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } else { if( g_bDisplayReady ) { FrameMove(); RenderFrame(); } } } Please Help me...Thanks a lot

Share this post


Link to post
Share on other sites
Holy Fuzz    213
Don''t worry, I can tell you everything''s fine without even looking over your code. Is your refresh rate set to 75? Whenever your update interval is set to default then Direct3D WILL NOT draw faster than your refresh rate. Therefore, if your refresh rate was 75 you''d never get over 75 fps.

Share this post


Link to post
Share on other sites
lookx2    122
Oh~~Thanks a lot~
I was using refresh rate with 75~~
But why the Direct3D sample can over the limited framerate, are there anything different?

Share this post


Link to post
Share on other sites