-
Notifications
You must be signed in to change notification settings - Fork 68
/
Graphics.h
37 lines (28 loc) · 922 Bytes
/
Graphics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include <Windows.h>
#include <d3d11.h>
#include <string>
#include <wrl/client.h>
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "dxgi.lib")
namespace Graphics
{
// --- GLOBAL VARS ---
// Primary D3D11 API objects
inline Microsoft::WRL::ComPtr<ID3D11Device> Device;
inline Microsoft::WRL::ComPtr<ID3D11DeviceContext> Context;
inline Microsoft::WRL::ComPtr<IDXGISwapChain> SwapChain;
// Rendering buffers
inline Microsoft::WRL::ComPtr<ID3D11RenderTargetView> BackBufferRTV;
inline Microsoft::WRL::ComPtr<ID3D11DepthStencilView> DepthBufferDSV;
// --- FUNCTIONS ---
// Getters
bool VsyncState();
std::wstring APIName();
// General functions
HRESULT Initialize(unsigned int windowWidth, unsigned int windowHeight, HWND windowHandle, bool vsyncIfPossible);
void ShutDown();
void ResizeBuffers(unsigned int width, unsigned int height);
// Debug Layer
void PrintDebugMessages();
}