LB Booster
« Card graphics not sticking »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 05:11am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1 ... 3 4 5  Notify Send Topic Print
 veryhotthread  Author  Topic: Card graphics not sticking  (Read 213 times)
michael
New Member
Image


member is offline

Avatar




PM


Posts: 28
xx Re: Card graphics not sticking
« Reply #61 on: May 30th, 2016, 11:54pm »

There is of course these commands too that allow you to do draws behind the scenes and show the draws at will.

These are built into LBB but have BBC Basic origin
Just passing on what Richard sent me for off screen draws.

!*refresh off
!*refresh on
!*refresh

refresh off turns off the automatic refresh
refresh refreshes the screen and shows the updated draws
refresh on returns the automatic refresh to automatic.

We may as well offer this since it is a part of LBB.. (but is not a part of LB. So you wont be able to share such code in LB forums.
« Last Edit: May 31st, 2016, 12:24am by michael » User IP Logged

I make program generators and some utilities. Its my hobby
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Card graphics not sticking
« Reply #62 on: May 31st, 2016, 08:23am »

on May 30th, 2016, 11:54pm, michael wrote:
There is of course these commands too that allow you to do draws behind the scenes and show the draws at will.

Except that they only work when drawing graphics into the mainwin, so are not generally useful.

The easiest way to achieve 'flicker free' animated graphics in LBB (other than using sprites) is to use the normal JB/LB commands but to put them all - including the initial CLS - into a single string. That makes the best use of LBB's double-buffering:

Code:
    timer 40, [animate]
    wait
    
[animate]
    g$ = "cls;"
    g$ += "<graphics commands>;"
    g$ += "<more graphics commands>"
    #g g$
    wait 

By concatenating all the graphics commands for one 'frame' into a single string (sadly you can't do that if text is included) you avoid the possibility of Windows refreshing the screen when the graphics are only partly drawn, which is what results in flickering.

There may still be some 'tearing' (because the drawing isn't synchronized with the display refresh rate) but with care you can get good results this way.

Richard.
User IP Logged

Pages: 1 ... 3 4 5  Notify Send Topic Print
« Previous Topic | Next Topic »


This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls