slow d3d

Started by
4 comments, last by eal 19 years, 3 months ago
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]
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.
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
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;
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...
----------------------------------------------------"Plant a tree. Remove a Bush" -A bumper sticker I saw.
awesome, thanks

your rating++

This topic is closed to new replies.

Advertisement