It's the same effect as an Double buffer as far as maybe flicker,. tho in theory, it would sound as tho refresh rates might improve since it's cleaning, buffering, and viewing is done at the same time, opposed to cleaing and then drawing while viewing....
Oh well,. judge for yourself.. as I might be wrong.. =)
Code: Select all
'Triple Buffer Experament by Rattrapmax6
' 3Cylcle Page Buffer
'In this buffer, pages are pre-cleaned before
' being drawn to, and pre-drawn before viewed on the
' monitor. This was made with the goal of having a
' fresh clean buffer page to draw on, oppose to cleaning
' and then drawing on a buffer page..
'3Cycle Example
'Page 0 gets cleaned, Page 1 gets graphics drawn on it, Page 2 is seen by the user
'Page 2 gets cleaned, Page 0 gets graphics drawn on it, Page 1 is seen by the user
' ... and so on
SCREENRES 640,480, 32, 3 ' Set 3 pages insted of 2
DIM SHARED AS INTEGER CP = 0, WP = 1, VP = 2 'Give the pages names
T! = TIMER
DO
SCREENSET CP, VP ' Set screen that will clean
CLS 'Pre-Clean the screen
SCREENSET WP, VP 'Set screen to draw to, and the active video page
SWAP VP, CP ' Swap the buffers for the next loop
SWAP VP, WP '
' Draw the graphics...
X! += V!
IF X! > 640 THEN X! = 0
CIRCLE (X!, 240), 50, RGB(255, 0, 0)
L += 1
FPS! = L / (TIMER - T!)
V! = 500 / FPS!
LOOP UNTIL INKEY$ <> ""