LB Booster
« Speeding up LBB graphics »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:55am



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  Notify Send Topic Print
 thread  Author  Topic: Speeding up LBB graphics  (Read 331 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Speeding up LBB graphics
« Thread started on: Oct 16th, 2015, 10:48pm »

Sometimes LBB's graphics output is slower than LB's, and this Wiki article explains how that can often be resolved. A program posted by John Fisher at the Just BASIC forum illustrates this very well. The version published there runs noticeably more slowly in LBB than in LB, but if you modify it as below - i.e. create one long GUI command string - it runs more quickly in LBB:

Code:
    nomainwin

    UpperLeftX   =  20
    UpperLeftY   =  20
    WindowWidth  = 550
    WindowHeight = 570

    dim grid( 25, 25)

    for x =0 to 24
        for y =0 to 24
            grid( x, y) =int( 2 *rnd( 1))
        next y
    next x

    open "Show 2D array" for graphics_nsb as #wg

        #wg "trapclose [quit]"

        #wg "color white"
        gui$ = "down ; fill 60 60 60"

        for x =0 to 24
            for y =0 to 24
                gui$ += ";backcolor "
                if grid( x, y)=0 then gui$ += "black" else gui$ += "white"
                gui$ += ";place "; 20 +20 *x; " "; 20 +20 *y
                gui$ += "; boxfilled "; 20 +20 *x +16; " "; 20 +20 *y +16
            next y
        next x
        #wg gui$

        wait

[quit]
    close #wg
    end 

Of course this version is LBB-specific by virtue of the += operators. If you want to make it LB compatible you will need to substitute gui$ = gui$ +

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

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