Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change
Quote from: NoCforMe on April 25, 2025, 12:46:40 PMSo maybe I should concentrate on "everything"?Work on getting the double buffering working first. Once done, then you can do the boundary checks, and handle the resource issues (source of gdi leaks), imo.
Quote from: sinsi on April 25, 2025, 12:27:49 PMYes, shoulda warned you 'bout that. There's no code to check for boundary conditions (yet). Makes a mess.Quote from: NoCforMe on April 25, 2025, 12:08:50 PMQuestion: Does using double buffering mean that I draw everything to a separate buffer (my AltDC) and then copy that entire thing over to the display DC?Yes, everything.
I get artifacts when the bitmap is dragged past the top or left
Quote from: NoCforMe on April 25, 2025, 12:08:50 PMQuestion: Does using double buffering mean that I draw everything to a separate buffer (my AltDC) and then copy that entire thing over to the display DC?Yes, everything.
.elseif uMsg == WM_ERASEBKGND ; adding this helps greatly with flicker issues
mov eax, 1
ret
.elseif uMsg == WM_PAINT
invoke BeginPaint, hWin, addr ps
mov hDC, eax ; window client area DC
invoke CreateCompatibleDC, hDC
mov memDC, eax ; memory DC
invoke CreateCompatibleBitmap, hDC, ps.rcPaint.right, ps.rcPaint.bottom
mov hBmp, eax ; compatible bitmap handle
invoke SelectObject, memDC, hBmp
mov hBmp_old, eax
;; ###########################################################
;; in this example do all of your drawing here to memory DC (memDC) not to window DC (hDC)
;; ###########################################################
;; bitblt memory Dc to window DC
invoke BitBlt, hDC, 0, 0, ps.rcPaint.right, ps.rcPaint.bottom, memDC, 0, 0, SRCCOPY
invoke SelectObject, memDC, hBmp_old
invoke DeleteObject, hBmp
invoke DeleteDC, memDC
invoke EndPaint, hWin, addr ps
Quote from: zedd on April 25, 2025, 12:04:17 PMFor starters, you have a gdi leak...No doubt. Let's not worry about that for the moment. That's not the problem.
QuoteAlso, double buffering would indeed help.I'm going to read up on it next thing.
Quote from: sinsi on April 25, 2025, 06:12:00 AMMaybe 16-bit coding is not for you eitherIt used to be. Wrote a lot of .com programs back in the day. Device drivers and TSRs too.![]()