Files
david 204c55e915 Changed D3D9 to D3D11 api connection
Changed mesh to D3D11
Changed material to D3D11 (WIP)
2026-11-23 12:31:31 +01:00

27 lines
1.0 KiB
C++

#pragma once
#include <d3d11.h>
#pragma comment(lib, "d3d11.lib")
class Direct3D
{
public:
INT init(HWND hWnd, UINT width, UINT height, BOOL isFullscreen);
void beginScene();
void endScene();
void deInit();
ID3D11Device* getDevice() const { return _pD3DDevice; }
ID3D11DeviceContext* getDeviceContext() const { return _pD3DDeviceContext; }
private:
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
};