-
Dx Windowed LAG
In windowed mode Dx7...so I am blting to a window's client rect....
My comp begins to lag like you wouldn't believe. I click close and it takes almost like two minutes to for the app to close...I am serious no bs.
The line which does this is when I Blt to the Primary, could, by any chance this be due to the fact I am also repainting the background of the window when WM_PAINT is called? does a Dx DD Blt send a WM_PAINT message???
This is my first attemp at Dx7 Windowed, and I pretty much went by code in the SDK for an app which switched between the modes.
Any idea's?
-
Foregt about WM_PAINT, has nothing to do with a DX app...
-
Then what on earth could be causng the extreme lag.
In windowed mode its laggy, way to laggy...100% cpu usage.
In full screen its nothing, not even noticable, no spikes in cpu usage.
-
GetClientRect(m_hwnd, &m_rWindow);
GetClientRect(m_hwnd, &m_rScreen);
ClientToScreen(m_hwnd, (POINT*)&m_rScreen.left);
ClientToScreen(m_hwnd, (POINT*)&m_rScreen.right);
Changed:
PHP Code:
hRet = Primary->Blt(&m_rScreen, BackBuffer, &m_rWindow, DDBLT_WAIT, NULL); //Blt the Windowed buffer
To:
PHP Code:
hRet = Primary->Blt(&m_rScreen, BackBuffer, NULL, DDBLT_WAIT, NULL); //Blt the Windowed buffer
No lag...so far. An incredible increase in speed.
Once again tho, Dx7 in windowed mode when I Blt to the Primary ie. the window does it send a WM_PAINT message?
Also, should the backbuffers width and hieght be the size of my window or full screen during windowed mode.