0

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);
Beta Carotin
  • 1,659
  • 1
  • 10
  • 27
  • 1
    why would you want that? – spiritwolfform Jun 05 '13 at 10:31
  • 1
    you might also check this: http://msdn.microsoft.com/en-us/library/windows/desktop/bb172585(v=vs.85).aspx (`D3DPRESENT_INTERVAL_ONE`) – spiritwolfform Jun 05 '13 at 10:39
  • Because I want to see the actual speed. Thanks for the link. Using `D3DPRESENT_INTERVAL_IMMEDIATE`, I managed to increase the speed. Although it is still slower than on my weak old laptop, which is pretty strange. 6 ms versus 4 ms – Beta Carotin Jun 05 '13 at 12:12

0 Answers0