Changed D3D9 to D3D11 api connection

Changed mesh to D3D11
Changed material to D3D11 (WIP)
This commit is contained in:
2026-11-23 12:31:31 +01:00
parent abb8da9cff
commit 204c55e915
14 changed files with 288 additions and 182 deletions
+11 -4
View File
@@ -1,7 +1,7 @@
#pragma once
#include <d3d9.h>
#include <d3d11.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3d11.lib")
class Direct3D
{
@@ -11,9 +11,16 @@ public:
void endScene();
void deInit();
IDirect3DDevice9* getDevice() const { return _pD3DDevice; }
ID3D11Device* getDevice() const { return _pD3DDevice; }
ID3D11DeviceContext* getDeviceContext() const { return _pD3DDeviceContext; }
private:
IDirect3DDevice9* _pD3DDevice = nullptr; // our interface for api communication
ID3D11Device* _pD3DDevice = nullptr; // responsible for creating api object, e.g. buffers
ID3D11DeviceContext* _pD3DDeviceContext = nullptr; // responsible for customize the render pipeline, e.g. set buffers or making draw calls
IDXGISwapChain* _pDXGISwapChain = nullptr; // holds references to front and back buffer and swap them
ID3D11RenderTargetView* _pRenderTargetView = nullptr; // back buffer
ID3D11RasterizerState* _pRasterizerState = nullptr; // customize rasterizer stage
ID3D11DepthStencilView* _pDepthStencilView = nullptr; // depth stencil buffer
ID3D11DepthStencilState* _pDepthStencilState = nullptr; // customzie depth stencil buffer rendering
};