I am rendering to a System.Windows.Forms.Control
using Direct3D 9.
My render loop doesnt go faster than 120 FPS, which is the refresh rate of my screen. I tried changing the refresh rate and it did actually limit the render loop accordingly. Also, I found out that IDirect3DDevice9::Present(/*...*/)
is what limits the render speed. What can I do to remove this limitation?
D3D Initialization:
// ctrl : System::Windows::Forms::Control
int render_w = ctrl->Width;
int render_h = ctrl->Height;
HWND ctrl_hnd = (HWND)ctrl->Handle.ToPointer();
// d3dpp : D3DPRESENT_PARAMETERS
d3dpp.hDeviceWindow = ctrl_hnd;
d3dpp.Windowed = TRUE;
d3dpp.BackBufferWidth = render_w;
d3dpp.BackBufferHeight = render_h;
// and further settings...
// d3d : LPDIRECT3D9
// d3ddev : LPDIRECT3DDEVICE9
d3d->CreateDevice(
D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
ctrl_hnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
&d3dpp,
&d3ddev);