How to get directx 123/29/2024 ![]() Can someone please show me how to trace and fix errors like this? Thanks. I assume that bufferDesc and/or swapChainDesc has some invalid data but the compiler can't give me any clue what is responsible for the error. Whenever I call InitD3d11, I get an error saying that the swapChain is a NULL pointer. If I copy and paste code from tutorials, everything runs fine This is not the full code - I linked directx and lib files and stuff like that. Hr = dev->CreateRenderTargetView(backBuffer, NULL, &renderTarget) ĭevCon->OMSetRenderTargets(1, &renderTarget, NULL) Hr = swapChain->GetBuffer(0, _uuidof(ID3D11Texture2D), (void**)&backBuffer) Hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, NULL, NULL, NULL, D3D11_SDK_VERSION, &swapChainDesc, &swapChain, &dev, NULL, &devCon) SwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT ZeroMemory(&swapChainDesc, sizeof(DXGI_SWAP_CHAIN_DESC)) ZeroMemory(&bufferDesc, sizeof(DXGI_MODE_DESC)) īufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM īufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED īufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED Static ID3D11RenderTargetView* renderTarget Here is an example of the latest error that I can't fix after hours of research: //Header.h I've been learning DirectX by following some tutorials but every time I type something myself then DirectX won't work.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |