BOOL bRet = FALSE;
m_d3dpp.BackBufferWidth = 0;
m_d3dpp.BackBufferHeight = 0;
GetWindowRect(hwnd, &m_rcWindow);
RECT rect = {0, 0, nWidth, nHeight};
AdjustWindowRectEx(&rect, GetWindowLong(hwnd, GWL_STYLE),
FALSE, GetWindowLong(hwnd, GWL_EXSTYLE));
SetWindowPos(hwnd, HWND_NOTOPMOST, m_rcWindow.left, m_rcWindow.top,
rect.right - rect.left, rect.bottom - rect.top,
SWP_SHOWWINDOW);
//务必释放dx资源
OnDeviceLost();
HRESULT hResult = m_d3d_Device->Reset(&m_d3dpp);
if(!FAILED(hResult))
{
//重新设定dx资源
SetupResource();
bRet = TRUE;
}
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
return bRet;
真假全屏
m_bFullScreen = TRUE;
m_d3dpp.Windowed = !bRealFullScreen;
m_d3dpp.BackBufferWidth = GetSystemMetric