• Welcome to Dark Bit Factory & Gravity.
 

Double Buffer?

Started by Hotshot, March 24, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Hotshot

Hey all

I got sprites that move left to right but I cant get rid of flicker....
I have look in help file to find if there is double buffer or buffer. Do I have make my own double buffer?

cheers

MrP

Depends what your using to output your screen, tinyptc, gfxlib etc... If your using the tinyptc lib theres loads of articles on here about it and double buffering. If your using gfxlib I'm in the process of writing a tutorial on how to set it up and use it so you get silky smooth frame updates with no flickering.... Just started a new job 2 weeks or so ago and I aint had much time at the pc at all. The tutorial is about 75% complete and I intend to get more done today (possibly even finish it).... If its gfxlib your using I can definately help out.....

rdc

You can just wrap your screen updates with a screenlock and screenunlock.


screen 18, 32

dim x as integer = 1


do
    screenlock
    cls
    line(x, 200)-(x + 10, 210), RGB(255, 255, 255), BF
    screenunlock
    x += 1
    if x > 630 then x = 1
    sleep 20
loop until inkey <> ""
end


Looking forward to the tut MrP.

Hotshot

I used tinyptc and I will try screenlock things. I will look forward to ur tutorial mrp

cheers

docgen


Hi MrP!

I'm interested in your tutorial too! :)

rdc

If you are using tinyptc, then screenlock will probably not work as expected. What you need to do with ptc is clear the buffer and then write the whole page to the buffer. Once the page is written to the buffer, then you do an update.

Shockwave

Screenlock is useless in tinyptc, tinyptc takes care of double buffering, all gfx operations are performed on a block of memory before update and the whole lot is written to the screen in one go.

Shockwave ^ Codigos
Challenge Trophies Won: