Created
November 28, 2012 13:36
-
-
Save tuttlem/4161329 to your computer and use it in GitHub Desktop.
DestroyBackBuffer
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
DestroyBackBuffer PROC hWin:DWORD | |
; determine if we need to destroy the memory DC | |
cmp memDC, NULL | |
je MemoryDCDeallocated | |
; we do, so kill off these GDI objects | |
invoke SelectObject, memDC, memOldBitmap | |
invoke DeleteObject, memBitmap | |
invoke DeleteDC, memDC | |
; null them out so there's no confusion | |
mov memDC, NULL | |
mov memOldBitmap, NULL | |
mov memBitmap, NULL | |
MemoryDCDeallocated: | |
; determine if we need to release the window dc | |
cmp winDC, NULL | |
je WindowDCReleased | |
; we do - release and null | |
invoke ReleaseDC, hWin, winDC | |
mov winDC, NULL | |
WindowDCReleased: | |
xor eax, eax | |
ret | |
DestroyBackBuffer ENDP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment