Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FLICKER
#1
I wrote a program that draws a circle, paints it, then clears the screen and draws a -3 smaller circle, paints it, etc. It's doing what I want, but because of the CLS, it's VERY flickery. Is there a way to get the same result without the flicker? Thanks, Richard
Reply
#2
http://faq.qbasicnews.com/?blast=DoubleBufferingGeneral

;)

If it confuses you, scroll all the way down to the bottom and have a look at the example. Try it out yourself, then try play with it a bit.
Reply
#3
One thing that you could do (that is less confusing than double buffering)...

Just make a black box around the circle that you want to delete:

Line (x,y)-(x2,y2),0,BF

then it's like clearing the screen but it only blots out what you don't want, reducing flicker. It's not perfect, and it's not as nice as double-buffering, but it works quite well for simple stuff.
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply
#4
put this before your loop repeats


Code:
Wait &H3da, 8
Wait &H3da, 8, 8
Reply
#5
Thanks for the suggestions!
Reply
#6
cha0s, might I suggest telling him what this piece of code does?

What it does is waits for your monitor to clear the current cycle and start afresh, so your program is drawing with the monitor on it's cycle than having it draw 1 frame over two monitor cycles, or two over 1 cycle...

Insert that into your loop right before you start drawing. Using this in combination with double buffering, ie: before the page flip, makes things a whole lot smoother.

Good luck.
Screwing with your reality since 1998.
Reply
#7
search the forum gfor my name and that code snippet.

you can only say the same thing so many million times, so... you can do it now ^^
Reply
#8
UPPERCASE
Reply
#9
...come again? o.o
Reply
#10
Quote:...come again? o.o
Topic title.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)