SwapChain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0) Console::WriteLine("windowResizing = false") ĭ3d11_DeviceContext->ClearRenderTargetView(d3d11_RenderTargetView, color) Īnd this is my method which I call when window resizing:ĭ3d11_DeviceContext->OMSetRenderTargets(0,0,0) Void D3D11::BeginScene(float red, float green, float blue, float alpha) I implement resizing swapchain method and now when i resize window, my rendering crash in BeginScene method in line:ĭ3d11_DeviceContext->ClearDepthStencilView(d3d11_DepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0) Thanks, It works, But I have now another problem:
Now I want to understand how to organize thread to leave message pump outside (in main thread), but listen this messages inside second thread.Ĭorrect me if I'm wrong, please. That lead window to get stuck in that time when rendering goes well. So, As I understand the main my problem is that I have message pump run in another thread, but window is main thread, so messages cant be read. I did my engine structure almost exactly as in rastertek lessons if you see them. If (PeekMessage(&msg, NULL, 0, 0,PM_REMOVE)) In initializeSystem() I do initialization of D3D, Camera, DirectInput Thread^ newThread = gcnew Thread(threadDelegate) Ĭonsole::WriteLine(exception->Message + exception->StackTrace + exception->TargetSite) ThreadStart^ threadDelegate = gcnew ThreadStart(managed, &ManagedEngine::StartEngine)
ManagedEngine^ managed = gcnew ManagedEngine() I want to create another thread and make rendering there, but I don`t know how to correctly do that, because if I start rendering loop in other thread, messages seems not to reach window or something like that. When I move/drag/resize a window, my message pump get stuck and window content is not updated (well known problem with DefWIndowProc).