add D3D11 project

This commit is contained in:
2025-11-19 09:43:09 +01:00
parent 9134d2dc40
commit bff01f5adb
36 changed files with 2779 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#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(FLOAT r, FLOAT g, FLOAT b);
void endScene();
void deInit();
ID3D11Device* getDevice() const { return _pD3DDevice; }
ID3D11DeviceContext* getDeviceContext() const { return _pD3DDeviceContext; }
private:
ID3D11Device* _pD3DDevice = nullptr; // needed for creating all objects, e.g. buffer, textures, etc., used in init phase
ID3D11DeviceContext* _pD3DDeviceContext = nullptr; // access to render pipeline, e.g. set matrices or draw command, used in run phase
IDXGISwapChain* _pDXGISwapChain = nullptr; // holds references to front & back buffer & swaps them
ID3D11RenderTargetView* _pD3DRenderTargetView = nullptr; // target device context is rendering to
};