27 lines
990 B
C++
27 lines
990 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();
|
|
void endScene();
|
|
void deInit();
|
|
|
|
ID3D11Device* getDevice() const { return _pD3DDevice; }
|
|
ID3D11DeviceContext* getDeviceContext() const { return _pD3DDeviceContext; }
|
|
|
|
private:
|
|
ID3D11Device* _pD3DDevice = nullptr; // create other api objects, e.g. buffer
|
|
ID3D11DeviceContext* _pD3DDeviceContext = nullptr; // customize render pipeline, e.g. set buffer or make 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; // customize depth stencil buffering
|
|
};
|
|
|