Jump to content
  • Advertisement
Sign in to follow this  
Claudio

Render() Frequency

This topic is 3213 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

Hi. I use DirectX 9. My question is: what is the frequency that the function "Render()" is called ? In other way what is the frequency refresh of the visual rendering phase ? It's imposted in the cpp code ? with the DirectX paramter ? --> .frequency ? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
There's no Render() function in DirectX9, the actual rendering is done when you call IDirect3DDevice9::Present(), and the frequency is up to the game engine programmer. Sometime it's the fastest the video card support it, while in other games it's at a certain fixed rate (let's say 60hz), so the physics can be more stable.

Share this post


Link to post
Share on other sites
Quote:
Original post by Claudio
DirectX 9. "Render()"


Hi.
I didn't show my function "render()". Excuse me. Here is the function:


render()
{
D3DDev->Clear(...);
D3DDev->SetIndices(...);
D3DDev->SetVertexDeclaration(...);
D3DDev->BeginScene();
unsigned int Passes;
D3DEffect->Begin(&Passes, 0);
for (unsigned int i = 0; i < Passes; i++)
{
D3DEffect->BeginPass(i);
D3DMesh->DrawSubset(0);
D3DEffect->EndPass();
}
D3DEffect->End();
D3DDev->EndScene();
D3DDev->Present(...);
}



where:
- "(...)" are the various parameters of the various fuction
- D3DDev is the D3D device
- D3DMesh is the 3D object
- D3DEffect is the effect (loading from a file "*.fx")

And the D3D is defined as:

// // // D3D present parameters: // // //
D3DPRESENT_PARAMETERS D3Dpp;
ZeroMemory(&D3Dpp, sizeof(D3Dpp));
// Fill of the structure D3Dpp
D3Dpp.BackBufferWidth = nWidth; // width of the back buffer
D3Dpp.BackBufferHeight = nHeight; // height of the back buffer
D3Dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
D3Dpp.BackBufferCount = 2; // number of back buffer
D3Dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
D3Dpp.MultiSampleQuality = 0;
D3Dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
D3Dpp.hDeviceWindow = hWindow;
D3Dpp.Windowed = true;
D3Dpp.EnableAutoDepthStencil = true;
D3Dpp.AutoDepthStencilFormat = D3DFMT_D16;
D3Dpp.Flags = 0;
D3Dpp.FullScreen_RefreshRateInHz = 0;
D3Dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;



Share this post


Link to post
Share on other sites
Your presentation interval is set to D3DPRESENT_INTERVAL_DEFAULT, which mean you'll render at the refresh rate of your monitor.

You can call your Render() function as often as you like, but Present() will block to the refresh rate of your monitor.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Your presentation interval is set to D3DPRESENT_INTERVAL_DEFAULT, which mean you'll render at the refresh rate of your monitor.

You can call your Render() function as often as you like, but Present() will block to the refresh rate of your monitor.


Hi.

How can I get the frequency of the monitor ? Is there one function so ?

Share this post


Link to post
Share on other sites
Quote:
Original post by Claudio
How can I get the frequency of the monitor ? Is there one function so ?
Why? There's very little you can do with that information...

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!