flat assembler
Message board for the users of flat assembler.
Index
> Windows > dib and blinking problem |
Author |
|
edfed 24 Feb 2013, 19:05
maybe you should take care of vsync. i don't know if it is needed in windows applications, but it may be a similar problem.
|
|||
24 Feb 2013, 19:05 |
|
comrade 24 Feb 2013, 23:22
dev_89, what is the window style (CS_*) in WNDCLASS/WNDCLASSEX you are using? Perhaps Windows is needlessly erasing the window background, only for you to paint over it immediately. Can you share out your source code?
|
|||
24 Feb 2013, 23:22 |
|
Spool 25 Feb 2013, 05:24
[ Post removed by author. ]
Last edited by Spool on 17 Mar 2013, 10:42; edited 1 time in total |
|||
25 Feb 2013, 05:24 |
|
dev_89 25 Feb 2013, 09:45
here is my code.
this code gets called only when windows sends WM_PAINT message: Code: proc CpyGFX local ps PAINTSTRUCT invoke BeginPaint,[App.hwnd],addr ps invoke BitBlt,[App.hdc],0,0,ScreenWidth,ScreenHeight,[CanvasDc],0,0,SRCCOPY invoke EndPaint,[App.hwnd],addr ps ret endp and here is the dialog style: 1 DIALOG 0, 0, 250, 150 STYLE DS_CENTER | WS_POPUP | WS_CLIPCHILDREN and here is the timer code that draws everything to the canvas buffer: Code: proc DrawGFX local rc RECT pushad ;clean up all of the buffers mov edi,[CanvasBuf] mov ecx,ScreenWidth * ScreenHeight mov ebx,ecx xor eax,eax repe stosd mov edi,[CanvasInfoBuf] mov ecx,ebx xor eax,eax repe stosd mov edi,[CanvasBdBuf] mov ecx,ebx xor eax,eax repe stosd ;draw everything to the buffers stdcall DrawBitmapImg,0,0,LogoM,[CanvasBuf] stdcall SetText,100,100,PrText,1,Text1 call DrawBlood .if byte [InfoF] = 1 call DrawInfo .endif ;refresh the main window invoke GetClientRect,[App.hwnd],addr rc invoke RedrawWindow,[App.hwnd],addr rc,0,RDW_INVALIDATE popad ret endp |
|||
25 Feb 2013, 09:45 |
|
dev_89 25 Feb 2013, 15:28
i just been able to get rid of the flicker on the dialog by handling WM_ERASEBKGND and return true but flicker on the controls still exists.
|
|||
25 Feb 2013, 15:28 |
|
bitRAKE 26 Feb 2013, 08:00
Are you updating the window twice: WM_PAINT and WM_ERASEBKGND. I like to use just WM_ERASEBKGND because it's passed a valid hDC. Also, setting the window background color to 0 - so windows doesn't trying to paint it a color.
|
|||
26 Feb 2013, 08:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.