Hi, hope you can help me one more time [crying]
(1) Present() fails every last time it is called, I cannot remember the dx error exactly, but the message might mean that the device window was already destroyed before Present() was called.
So something with my program termination handling might be wrong, here's some code:
// message loop
while (!this->m_bEndApp)
{
while (PeekMessage(&stMsg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&stMsg);
DispatchMessage(&stMsg);
}
if (!this->m_bEndApp)
// render and present
}
// in window procedure
case WM_DESTROY:
{
This->m_bEndApp = TRUE;
PostQuitMessage(0);
return 0;
}
break;
Is something wrong with this code? The program is exited by clicking the close cross (WM_CLOSE -> WM_DESTROY -> WM_QUIT).
(2) When I switch my video mode from a non-multisampled to a multisampled back buffer, Reset() fails, although the ms mode is supported by the device (when I create it with this ms mode, it doesn't fail AND the D3DCaps Viewer says the MS type is supported). However, it's not the case if I start with a multisampled back buffer und switch to a mode with another type of ms back buffer.
Reason: "Direct3D8: (ERROR) :Unsupported multisample type requested. CreateRenderTarget/CreateDepthStencil failed."
Normally, I would suppose that my depth buffer is not recreated with multisampling and that would be the reason, but look at my pseudo-code:
ReleaseUserMem();
ReleaseSwapChains();
ReleaseDepthStencil();
Reset();
if (DepthFormat != UNKNOWN)
{
CreateDepthStencilBuffer(zWidth, zHeight, zFormat, MSType);
}
Step by step:
a) Release all device memory
b) Reset the device with the new MS type, all other present params stay the same as before (no depth buffer specified)
c) Create the depth buffer
What is wrong? Maybe a driver issue?