Jump to content
  • Advertisement
Sign in to follow this  
eal

slow d3d

This topic is 5045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

does d3d restrict the speed of programs automatically? the author from the book i'm studying made this example: example.exe it seems like it should be running much faster than it does, considering nothing in the main program loop directly slows it down. [Edited by - eal on December 30, 2004 4:06:07 PM]

Share this post


Link to post
Share on other sites
Advertisement
I didn't download the example, sorry but dont just download executables (most people here probably dont aswell) that i dont know what exactly it is.

Can you better describe your problem, what the example is doing, what hardware are you running and how fast or slow it is running.

My guess would be that you have VSYNC on, if your fps is limited to 60,75,85 (whatever your monitor refresh rate is). I'm not too familiar with D3D but check the device create or present (swapbuffers) or the D3D SDK docs for it.

Share this post


Link to post
Share on other sites
so it works like this?

instead of going through the main loop as fast as possible, the program is slowed down to only loop 60 times a second or whatever

Share this post


Link to post
Share on other sites
ok apparently it does, after i tested the fps. is there any way to change this?

this is what i'm doing:



D3DDISPLAYMODE mode ;

mode.Height=RES_Y;
mode.Width=RES_X;
mode.RefreshRate=0;
mode.Format=D3DFMT_A8R8G8B8;

D3DPRESENT_PARAMETERS parameter;

parameter.AutoDepthStencilFormat = D3DFMT_UNKNOWN ;
parameter.BackBufferCount=1;
parameter.BackBufferFormat=mode.Format;
parameter.BackBufferHeight=RES_Y;
parameter.BackBufferWidth=RES_X;
parameter.EnableAutoDepthStencil = FALSE ;
parameter.Flags=0;
parameter.FullScreen_PresentationInterval=D3DPRESENT_INTERVAL_IMMEDIATE
parameter.FullScreen_RefreshRateInHz=0;
parameter.hDeviceWindow=windowhandle;
parameter.MultiSampleType=D3DMULTISAMPLE_NONE;
parameter.SwapEffect=D3DSWAPEFFECT_FLIP;
parameter.Windowed=FALSE;

Share this post


Link to post
Share on other sites
Quote:
Original post by eal
ok apparently it does, after i tested the fps. is there any way to change this?

this is what i'm doing:



D3DDISPLAYMODE mode ;

mode.Height=RES_Y;
mode.Width=RES_X;
mode.RefreshRate=0;
mode.Format=D3DFMT_A8R8G8B8;

D3D8OBJ->EnumAdapterModes ( D3DFMT_A8R8G8B8 , 0 , &mode ) ;

D3DPRESENT_PARAMETERS parameter;

parameter.AutoDepthStencilFormat = D3DFMT_UNKNOWN ;
parameter.BackBufferCount=1;
parameter.BackBufferFormat=mode.Format;
parameter.BackBufferHeight=RES_Y;
parameter.BackBufferWidth=RES_X;
parameter.EnableAutoDepthStencil = FALSE ;
parameter.Flags=0;
parameter.FullScreen_PresentationInterval=D3DPRESENT_INTERVAL_IMMEDIATE
parameter.FullScreen_RefreshRateInHz=0;
parameter.hDeviceWindow=windowhandle;
parameter.MultiSampleType=D3DMULTISAMPLE_NONE;
parameter.SwapEffect=D3DSWAPEFFECT_FLIP;
parameter.Windowed=FALSE;


Either turn your refresh rate up, or disable vsync...I am not sure, but I am fairly certain there is a way to do this through Direct3d...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!