-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDirectX9Manager.h
86 lines (71 loc) · 2.85 KB
/
DirectX9Manager.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
75
76
77
78
79
80
81
82
83
84
85
86
//----------------------------------------------------------------------------------------------
// DirectX9Manager.h
// Copyright (C) 2014 Dumonteil David
//
// MFNode is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MFNode is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------------------------------
#ifndef DIRECTX9MANAGER_H
#define DIRECTX9MANAGER_H
class CDirectX9Manager{
public:
CDirectX9Manager();
~CDirectX9Manager(){ ReleaseDirectX9(); }
HRESULT InitDirectX9(const UINT32, const UINT32);
void ReleaseDirectX9();
HRESULT OnFrameMove(IMFSample*);
HRESULT OnFrameRender();
static DWORD WINAPI StaticThreadProc(LPVOID);
void SetShaderReverseX(const BOOL bReverseX){ m_bReverseX = bReverseX; m_bSetbReverseX = TRUE; }
void SetShaderReverseY(const BOOL bReverseY){ m_bReverseY = bReverseY; m_bSetbReverseY = TRUE; }
void SetShaderNegatif(const BOOL bNegatif){ m_bNegatif = bNegatif; m_bSetNegatif = TRUE; }
void SetShaderGray(const BOOL bGray){ m_bGray = bGray; m_bSetGray = TRUE; }
void SetShaderGrayScale(const BOOL bGray){ m_bGrayScale = bGray; m_bSetGrayScale = TRUE; }
void SetVideoColor(const UINT uiColorMode){ m_uiColorMode = uiColorMode; m_bSetColorMode = TRUE; }
void SetVideoContrast(const FLOAT fContrast){ m_fContrast = fContrast; m_bSetContrast = TRUE; }
void SetVideoSaturation(const FLOAT fSaturation){ m_fSaturation = fSaturation; m_bSetSaturation = TRUE; }
private:
IDirect3D9 * m_pD3D9;
IDirect3DDevice9* m_pDevice9;
IDirect3DTexture9* m_pVideoTextureY;
IDirect3DTexture9* m_pVideoTextureU;
IDirect3DTexture9* m_pVideoTextureV;
ID3DXEffect* m_pVideoEffect;
CQuad m_cVideoFrame;
HWND m_hWnd;
UINT32 m_uiWidth;
UINT32 m_uiHeight;
HANDLE m_hRendererThread;
HANDLE m_hThreadReadyEvent;
DWORD m_dwThreadID;
BOOL m_bReverseX;
BOOL m_bSetbReverseX;
BOOL m_bReverseY;
BOOL m_bSetbReverseY;
BOOL m_bNegatif;
BOOL m_bSetNegatif;
BOOL m_bGray;
BOOL m_bSetGray;
BOOL m_bGrayScale;
BOOL m_bSetGrayScale;
UINT m_uiColorMode;
BOOL m_bSetColorMode;
FLOAT m_fContrast;
BOOL m_bSetContrast;
FLOAT m_fSaturation;
BOOL m_bSetSaturation;
BOOL InitWindow(const UINT32, const UINT32);
HRESULT InitWorldViewProj(const UINT32, const UINT32);
HRESULT FillTextureForBlack();
};
#endif