Author Topic: Double Buffer?  (Read 3549 times)

0 Members and 1 Guest are viewing this topic.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Double Buffer?
« on: March 24, 2007 »
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

Offline MrP

  • Atari ST
  • ***
  • Posts: 176
  • Karma: 18
    • View Profile
Re: Double Buffer?
« Reply #1 on: March 24, 2007 »
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.....

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Double Buffer?
« Reply #2 on: March 24, 2007 »
You can just wrap your screen updates with a screenlock and screenunlock.

Code: [Select]
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.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Double Buffer?
« Reply #3 on: March 26, 2007 »
I used tinyptc and I will try screenlock things. I will look forward to ur tutorial mrp

cheers

docgen

  • Guest
Re: Double Buffer?
« Reply #4 on: March 26, 2007 »

Hi MrP!

I'm interested in your tutorial too! :)

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Double Buffer?
« Reply #5 on: March 26, 2007 »
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.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Double Buffer?
« Reply #6 on: March 26, 2007 »
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: