#1
  1. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,905
    Rep Power
    3969

    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++.

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2002
    Location
    Seattle WA
    Posts
    863
    Rep Power
    14
    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.
  4. #3
  5. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    27
    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.

    Frank Zappa
  6. #4
  7. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,905
    Rep Power
    3969

    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.

IMN logo majestic logo threadwatch logo seochat tools logo