Teen Programmers Unite  
 

 

Return to forum top

Windows screen 'flicker'

Posted by nid [send private reply] at July 30, 2001, 04:40:32 PM

I have noted that a lot of the programs I make have annoying flicker when they are repainted. Now, I am going to guess this is because of my incompetance and not a feature of Windows, so I would like to ask if anyone has any suggestions about how to get rid of it? What causes it, just poor handling of the WM_PAINT message? Is there anything in particular to look out for? Thanks!

Posted by grandsnafu [send private reply] at July 30, 2001, 04:42:42 PM

sounds like a great "feature" to me. Seriously, though, I don't know. It's probably not windows...for once...

Posted by Psion [send private reply] at July 30, 2001, 07:17:54 PM

You should be drawing to a buffer, then swapping that buffer with the actual window graphics area when you're done drawing a frame. This is called "double buffering."

Posted by nid [send private reply] at July 30, 2001, 11:42:53 PM

Hmm... what exactly does that mean? Do you know a web site where I could find more information about that? Right now I am using sprintf() and then printing the buffer with TextOut(). I am also using the C++ string and calling the c_str() member function. How do I swap the buffer with the actual window graphics area, I'm guessing that's not what TextOut() does :) I'm also using the Rectangle() function.

Posted by CHollman82 [send private reply] at October 01, 2001, 10:08:35 PM

Posted by gian [send private reply] at July 31, 2001, 02:09:01 AM

CHollman82: We all have to start somewhere...

Posted by lordaerom [send private reply] at July 31, 2001, 02:58:52 AM

GDC?
GDI!

Posted by Psion [send private reply] at July 31, 2001, 06:14:12 AM

A quick search brings up this Windows double buffering example source. You can obviously do your own to find more info.
http://www.mcarp.org/ftp/blit.zip

Posted by CHollman82 [send private reply] at October 01, 2001, 10:09:20 PM

Posted by gian [send private reply] at August 01, 2001, 02:15:59 AM

I will eternally fight you to the bitter end... I will criticise your every move... for you are one that you love to hate. TPU would not be the same without your ability to make mistakes, but not be able to admit them.

Thank you, CHollman82... you brighten my day.

I will look forward to your semi-funny, really stupid post making a either a personal attack on me, or some criticism of something I have done.

Thank you for not going away when it is so very clear that you are not wanted! It is great to have someone who can suck the life out of any meaningful conversation, and turn it into a personal attack... so now, and I think I speak on behalf of the majority of TPU members when I say that we would looooveeee to return your kindness.

Posted by CHollman82 [send private reply] at October 01, 2001, 10:09:32 PM

Posted by sphinX [send private reply] at August 02, 2001, 12:20:20 AM

yes, very interesting. i have nothing against you chollman, nor against gian....you both provide my daily amusement --- like watching a married couple fight :-)

Posted by have_dinner [send private reply] at August 02, 2001, 01:13:54 AM

what language we tlaking here??

Posted by lordaerom [send private reply] at August 02, 2001, 01:33:50 AM

With regard to the DC stuff? No specific language. Win32 API stuff, so, 'by default', C.

Posted by buzgub [send private reply] at August 02, 2001, 01:54:24 AM

By the way, I don't think you can _have_ a hDC function. you usually use a hDC when calling GDI functions. I suppose a function that dealt specifically with hDC's could be _described_ as a hDC function, but that would be a sort of slang identifier.

Posted by gian [send private reply] at August 02, 2001, 03:33:02 AM

CHollman82: Wow, don't you feel like a better person for doing that?

SphinX: Are you implying something?

Posted by sphinX [send private reply] at August 02, 2001, 05:27:01 AM

gian: only what everyone already knows...you do as good a job of hiding a sex scandal as good old Bill "I like my interns" Clinton

Posted by gian [send private reply] at August 02, 2001, 11:09:15 PM

Well, that was only that once... and you couldn't say that I really consented...

Posted by sphinX [send private reply] at August 03, 2001, 12:59:33 AM

heh...point taken and duly noted :-)

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.