Files
hwr2023_a/GDP/D3D11/Direct3D.h
T
2025-12-03 15:50:25 +01:00

24 lines
844 B
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(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
};