Skip to content

Instantly share code, notes, and snippets.

@tuttlem
Created November 28, 2012 13:43
Show Gist options
  • Save tuttlem/4161383 to your computer and use it in GitHub Desktop.
Save tuttlem/4161383 to your computer and use it in GitHub Desktop.
DoubleBuffer - MessagePump
StillRunning:
; check if there are messages on the queue to process
invoke PeekMessage, ADDR msg, NULL, 0, 0, PM_REMOVE
; if not, get on with rendering
cmp eax, 0
je RenderFrame
; dispatch the message as needed
invoke DispatchMessage, ADDR msg
RenderFrame:
; --- do some drawing here ---
; tell windows that the client area for this window is no
; longer valid and needs to be re-drawn
invoke InvalidateRect, hWnd, NULL, 0
cmp bRunning, 1
je StillRunning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment