forked from AgoraIO/API-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathD3DRender.h
More file actions
34 lines (31 loc) · 956 Bytes
/
D3DRender.h
File metadata and controls
34 lines (31 loc) · 956 Bytes
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
#pragma once
#include <d3d9.h>
/**
* D3DRender
* You'll need to call the Init function to pass in an HWND and window size
* that supports YUV data and RGB data.The incoming data can then be called to Render.
*
*/
class D3DRender {
public:
D3DRender();
~D3DRender();
public:
//initialize window
//hwnd is render to window.nWidth is buffer width not window width,nHeight is buffer height not window height,
//isYuv to identify yuv
int Init(HWND hwnd, unsigned int nWidth, unsigned int nHeight, bool isYuv);
//release d3d handle
void Close();
//accept buffer data to render window.
bool Render(char *buffer);
private:
bool m_bIsYuv;
int m_nWidth;
int m_nHeight;
RECT m_rtViewport;
CRITICAL_SECTION m_critial;
IDirect3D9 *m_pDirect3D9;
IDirect3DDevice9 *m_pDirect3DDevice;
IDirect3DSurface9 *m_pDirect3DSurfaceRender;
};