Files
2026-10-19 18:30:50 +02:00

27 lines
1.1 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; // 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
ID3D11DepthStencilView* _pD3DDepthStencilView = nullptr; // saves depth & stencil value of every pixel
ID3D11DepthStencilState* _pD3DDepthStencilState = nullptr; // set the current settings for depth-stenciling
ID3D11RasterizerState* _pD3DRasterizerState = nullptr; // set additional settings for the render pipeline
};