October 27th, 2002, 10:48 PM
Flickering w/ Win32 API and Painting
I've been making simple game type things lately to help figure out how to use the windows API and they work ok for the most part, but my breakout game that I made flickers alot and I'm wondering if anyone here may have some ideas as to how to prevent it, or reduce the amount.
The script is pretty long, so I just put it on my site at http://kicken.mine.nu:8008/extras/cpp/breakout/
Everything needed to run it should be there.
I'm using Borland's free C++ compiler to build the programs. Havn't got MSVC++.
October 28th, 2002, 02:36 AM
Don't have time to look at the code: there's way too much there. Usually, you check to see if the object needs painting, and only paint if you need to. That is, if you're going to be painting the same thing that's already there, don't do it.
October 28th, 2002, 11:52 PM
Too busy to read ALL your code (and it took more than 30 sec to load the page).
Are you using a framebuffer?
Finishing all drawing before calling a paint?
using GetUpdateRect() before calling BeginPaint()?
Returning TRUE to WM_ERASEBKGD msg's if your controls are flickering?
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.
October 29th, 2002, 08:31 PM
I'll check it out.
Well, sorry for the long load times, running that site of my local connection which is pretty slow. Also I know there is a lot of code and that's fine that you didn't look through it all (wasn't really expecting anyone to, just though i'd provide it).
I'm still learning the terms of the trade so not sure what a 'Frame buffer' is, but I'll look into it. I'll look into those functions and messages also. Thanks for your help and ideas.