Created
November 28, 2012 13:33
-
-
Save tuttlem/4161317 to your computer and use it in GitHub Desktop.
RecreateBuffer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RecreateBackBuffer PROC hWin:DWORD | |
; make sure we've destroyed anything already setup | |
invoke DestroyBackBuffer, hWin | |
; get an updated reading on the window's area | |
invoke GetClientRect, hWin, ADDR clientRect | |
; acquire a new DC for the window | |
invoke GetDC, hWin | |
mov winDC, eax | |
; create a new memory DC based off the window DC | |
invoke CreateCompatibleDC, winDC | |
mov memDC, eax | |
; make eax,ebx the width,height pair | |
mov eax, clientRect.right | |
sub eax, clientRect.left | |
mov ebx, clientRect.bottom | |
sub ebx, clientRect.top | |
; create our off-screen drawing surface | |
invoke CreateCompatibleBitmap, winDC, eax, ebx | |
mov memBitmap, eax | |
; this is where we'll draw to from here on | |
invoke SelectObject, memDC, memBitmap | |
mov memOldBitmap, eax | |
xor eax, eax | |
ret | |
RecreateBackBuffer ENDP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment