Repository navigation
Expand file tree
/
Copy pathDXGICapture.cpp
More file actions
64 lines (52 loc) · 1.36 KB
/
Copy pathDXGICapture.cpp
File metadata and controls
64 lines (52 loc) · 1.36 KB
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
#include "DXGICapture.h"
#include "WinDesktopDup.h"
// Windows Desktop Duplication dll member
WinDesktopDup dup;
extern "C" {
DXGICAPTURE_API void DXGI_SetTimeout(UINT ms)
{
dup.SetTimeout(ms);
}
DXGICAPTURE_API BOOL DXGI_InitCapture(void)
{
return dup.Initialize();
}
DXGICAPTURE_API int DXGI_OutputsCount(void)
{
return static_cast<int>(dup.CapturesCount());
}
DXGICAPTURE_API int DXGI_AdaptersCount(void)
{
return static_cast<int>(dup.AdaptersCount());
}
DXGICAPTURE_API void DXGI_GetOutputDescription(int index, DXGI_OUTPUT_DESC* desc)
{
if (!desc) return;
*desc = dup.GetOutputDescription(index);
}
DXGICAPTURE_API void DXGI_GetAdapterDescription(int index, DXGI_ADAPTER_DESC1* desc)
{
if (!desc) return;
*desc = dup.GetAdapterDescription(index);
}
DXGICAPTURE_API void DXGI_DeInitCapture(void)
{
dup.Close();
}
DXGICAPTURE_API HBITMAP DXGI_UpdateFrame(void)
{
if (dup.IsEnabled())
return dup.CaptureNext(0);
return NULL;
}
DXGICAPTURE_API HBITMAP DXGI_CaptureScreen(int index)
{
if (dup.IsEnabled())
return dup.CaptureNext(index);
return NULL;
}
DXGICAPTURE_API BOOL DXGI_IsEnabled(void)
{
return dup.IsEnabled();
}
}