Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Show Off Your Open Source Projects (http://www.programmingforums.org/forum52.html)
-   -   Connect four help (http://www.programmingforums.org/showthread.php?t=14663)

09jyoung Dec 2nd, 2007 9:54 PM

Connect four help
 
hello... i'm writing a C++/Win32 connect four program... its still in development... but the source can be found here[link]... i'm doing alright... except with updating the board... I used InvalidateRect(hWnd,NULL,true) to update it... the problem is that this updates the entire screen and causes it to flicker... does anyone know any better methods?

Jimbo Dec 2nd, 2007 10:18 PM

Re: Connect four help
 
Please don't double post your question.

Adak Dec 28th, 2007 11:27 AM

Re: Connect four help
 
Quote:

Originally Posted by 09jyoung (Post 137951)
hello... i'm writing a C++/Win32 connect four program... its still in development... but the source can be found here[link]... i'm doing alright... except with updating the board... I used InvalidateRect(hWnd,NULL,true) to update it... the problem is that this updates the entire screen and causes it to flicker... does anyone know any better methods?

I'm not a C++ user, but I had something similar with my chess program, in C. The problem was I was updating the entire chessboard every time a single piece was moved.

The answer to get rid of the flicker was to just update two squares on the board - the piece's from square, and the square the piece is moving to. End of annoying screen flicker. :)

You might be able to use InvalidateRect, as you do now, but send it the parameters of the two squares that need updating, in two calls.


All times are GMT -5. The time now is 3:41 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC