DirectX Crash When Resizing Tiny

家住魔仙堡 提交于 2019-12-11 05:23:19

问题


I am trying to make my program more bullet proof. My program resizes fine until I make it super tiny like this:

A method to prevent that from happening is to set a minimum size, which I know how to do already. I want to look deeper into the problem before I do that.

The following is where the functions start to crash.

hr=swapChain->ResizeBuffers(settings.bufferCount, settings.width, settings.height, DXGI_FORMAT_UNKNOWN, 0);
if(FAILED(hr)) return 0;

I figured it was because the buffer was too small, so I made a fail safe buffer size. It also failed though.

hr=swapChain->ResizeBuffers(settings.bufferCount, fallback.width, fallback.height, DXGI_FORMAT_UNKNOWN, 0);
if(FAILED(hr)) return 0;

What is the reason the program chokes when I make it tiny? I thought it was the buffers being too small. Doesnt seem like it is the case.

Edit:
Been a while since I posted this, so my code has changed a lot. Now it gives an unhandled exception crash when calling deviceContext->ClearRenderTargetView().

来源:https://stackoverflow.com/questions/12949520/directx-crash-when-resizing-tiny

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!