Skip to content

Commit 78c9673

Browse files
committed
Update PushSourceDesktop.cpp
i cant C/C++ :D but look at this, something similiar should work.
1 parent a09f987 commit 78c9673

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

source_code/PushSourceDesktop.cpp

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@
66
#include <wmsdkidl.h>
77

88

9+
typedef BOOL (*custom_BitBlt)(
10+
HDC hdcDest,
11+
int nXDest,
12+
int nYDest,
13+
int nWidth,
14+
int nHeight,
15+
HDC hdcSrc,
16+
int nXSrc,
17+
int nYSrc,
18+
DWORD dwRop);
19+
typedef HDC (*custom_CreateCompatibleDC)(HDC hdc);
20+
typedef HDC (*custom_CreateCompatibleBitmap)(
21+
HDC hdc,
22+
nWidth,
23+
nHeight);
24+
25+
26+
// custom_BitBlt _custom_BitBlt;
27+
// hInstLibrary = LoadLibrary("BroodWarCapture.dll");
28+
// _custom_BitBlt = (custom_BitBlt)GetProcAddress(hInstLibrary,"SCBW_BitBlt");
29+
//
30+
//
31+
//
32+
933
#define MIN(a,b) ((a) < (b) ? (a) : (b)) // danger! can evaluate "a" twice.
1034

1135
DWORD globalStart; // for some debug performance benchmarking
@@ -430,7 +454,7 @@ void CPushPinDesktop::doJustBitBltOrScaling(HDC hMemDC, int nWidth, int nHeight,
430454
}
431455

432456
// Bit block transfer from screen our compatible memory DC. Apparently this is faster than stretching.
433-
BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, captureType);
457+
_custom_BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, captureType);
434458
// 9.3 ms 1920x1080 -> 1920x1080 (100 fps) (11 ms? 14? random?)
435459
}
436460
else {
@@ -609,4 +633,4 @@ HRESULT CPushPinDesktop::OnThreadCreate() {
609633
previousFrameEndTime = 0; // reset <sigh> dunno if this helps FME which sometimes had inconsistencies, or not
610634
m_iFrameNumber = 0;
611635
return S_OK;
612-
}
636+
}

0 commit comments

Comments
 (0)