forked from TheRealMJP/SamplePattern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SamplePattern.h
75 lines (55 loc) · 1.76 KB
/
SamplePattern.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//======================================================================
//
// MSAA Sample Pattern Inspector
// by MJP
// http://mynameismjp.wordpress.com/
//
// All code licensed under the MIT license
//
//======================================================================
#pragma once
#include "SampleFramework11/PCH.h"
#include "SampleFramework11/App.h"
#include "SampleFramework11/InterfacePointers.h"
#include "SampleFramework11/Camera.h"
#include "SampleFramework11/Model.h"
#include "SampleFramework11/SpriteFont.h"
#include "SampleFramework11/SpriteRenderer.h"
#include "SampleFramework11/Skybox.h"
#include "SampleFramework11/GraphicsTypes.h"
#include "SampleFramework11/Slider.h"
using namespace SampleFramework11;
class SamplePattern : public App
{
protected:
SpriteFont font;
SpriteFont smallFont;
SpriteRenderer spriteRenderer;
RenderTarget2D sampleTarget;
RenderTarget2D patternTarget;
ID3D11Texture2DPtr stagingTexture;
ID3D11ShaderResourceViewPtr whiteTexture;
UINT currMSAAMode;
ID3D11PixelShaderPtr patternDetectShaders[D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT];
std::vector<DXGI_SAMPLE_DESC> msaaModes;
ID3D11RasterizerStatePtr msaa2xRState;
ID3D11RasterizerStatePtr msaa4xRState;
ID3D11RasterizerStatePtr msaa8xRState;
bool useCustomSampling;
bool nvExtensionsAvailable;
struct PatternDetectConstants
{
UINT PixelPosX;
UINT PixelPosY;
};
ConstantBuffer<PatternDetectConstants> patternDetectConstants;
virtual void LoadContent();
virtual void Render(const Timer& timer);
virtual void Update(const Timer& timer);
virtual void BeforeReset();
virtual void AfterReset();
void SetupMSAAMode();
void RenderHUD();
public:
SamplePattern();
};