-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathToScreen.h
54 lines (40 loc) · 1.11 KB
/
ToScreen.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
#ifndef _TO_SCREEN__H
#define _TO_SCREEN__H
#include "stdafx.h"
struct TriVertex
{
float pos[3];
};
class ToScreen
{
public:
ToScreen();
~ToScreen();
void Release();
HRESULT Init(HWND hwnd);
HRESULT Update(float deltaTime);
HRESULT Render();
HRESULT SetPixelColor(unsigned int x, unsigned int y, BYTE r, BYTE g, BYTE b);
void BlitScreen(unsigned char* src);
unsigned int mScreenWidth;
unsigned int mScreenHeight;
private:
D3D10_DRIVER_TYPE mDriverType;
IDXGISwapChain* mSwapChain;
ID3D10RenderTargetView* mRenderTargetView;
ID3D10Texture2D* mDepthStencil;
ID3D10DepthStencilView* mDepthStencilView;
ID3D10Device* mDevice;
ID3D10Texture2D* mTexture;
BYTE* mScreenPixels;
ID3D10Resource* mCurrentFrame;
ID3D10ShaderResourceView* mCurrentFrameView;
//shader variables
ID3D10VertexShader* mVertexShader;
ID3D10PixelShader* mPixelShader;
ID3D10SamplerState* mTextureSampler;
private:
HRESULT CompileShader(char* shaderFile, char* pEntrypoint, char* pTarget, D3D10_SHADER_MACRO* pDefines, ID3DBlob** pCompiledShader);
HRESULT CreateShadersAndInputLayout();
};
#endif