-
Notifications
You must be signed in to change notification settings - Fork 1
/
Renderer.h
42 lines (26 loc) · 883 Bytes
/
Renderer.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
38
39
40
41
42
#pragma once
#include <d3d11.h>
#include <dxgi.h>
#include <string>
#include "Render/RenderMesh.h"
// Handles all the global DirectX state.
const float PI = 3.1415926535897932384626433832795f;
namespace Renderer
{
extern IDXGISwapChain* SwapChain;
extern ID3D11Device* Device;
extern ID3D11DeviceContext* ImmediateContext;
HRESULT Initialize(const int& bufferWidth, const int& bufferHeight);
HRESULT Resize(const int& bufferWidth, const int& bufferHeight);
int GetBufferWidth();
int GetBufferHeight();
void BeginScene();
void EndScene();
void Present();
void Dispose();
ID3DBlob* ReadBlobFromFile(const std::wstring& filename);
void SetView(const DirectX::SimpleMath::Matrix& view);
DirectX::SimpleMath::Matrix GetView();
DirectX::SimpleMath::Matrix GetProjection();
void Render(RenderMesh* const mesh, const DirectX::SimpleMath::Matrix& transform);
}