#pragma once #include #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 };