
Jittery graphics using Borland 3.1 and BGI graphics
Quote:
>I have been playing around with graphics for an assignment I have. I have been making
>objects move by getimage()ing them and then putimage()ing them into changing locations
>followed by erasing the previous image. This works but the image is dim and
>flickering. I believe I am running in to problems with timing and the refresh of the
Borland BGI is too slow for good movement. However, you might try page
flipping:
1). setactivepage(0);setvisualpage(1);
2). do your stuff in page 0
3). setactivepage(1);setvisualpage(0);
and so on.
Quote:
>screen. I have tried different delays and printing mutiple images at the same time
>without much luck.
>Does Borland C and its BGI graphics have some sort of sync function like some other
Not that I know of. As faras I understand, BGI works through BIOS,
which is the worst way to do graphics.
Quote:
>languages to help with this. Any other methods of making the thing look smooth would
>be appreciated.
Try redrawing only parts of it. That is, if you have this image:
#+--------+
#| :-)|
#| :-) |
#+--------+
and you want to shift it one position to the right, you have to
erase only this (marked with #s) column, not the whole thing. Then,
redraw your image. You might also try displaying the image first
(remembering its old position), then doing all the calculations, then
quickly removing it from the old position and drawing it in new one.
The time for calculations would act as a mini-delay, minimizing the
time the image is off the screen => reducing flicker.