LB Booster
« re: endless graphics draws and LBBooster »

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



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 2  Notify Send Topic Print
 hotthread  Author  Topic: re: endless graphics draws and LBBooster  (Read 1682 times)
michael
Guest
xx Re: re: endless graphics draws and LBBooster
« Reply #4 on: Sep 9th, 2015, 3:26pm »

One more question.. I was looking at your documentation on LBB and it mentioned it made everything in a stand alone program.
Does this mean the bmp images and the wave files ...ect are inserted into the executable ?!!! :O

Oh and here is a link to the gxGL library code
http://basic.wikispaces.com/gx+Graphics+Library

« Last Edit: Sep 9th, 2015, 3:31pm by michael » User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx Re: re: endless graphics draws and LBBooster
« Reply #5 on: Sep 9th, 2015, 3:48pm »

on Sep 9th, 2015, 3:20pm, Richard Russell wrote:
As far as OpenGL is concerned that is definitely compatible with LBB, as the author of Cabinet Planner can I think confirm!

Richard.


Yes it is, and with the added speed of LBB, 3d graphics render much more smoothly.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: re: endless graphics draws and LBBooster
« Reply #6 on: Sep 9th, 2015, 5:20pm »

on Sep 9th, 2015, 3:26pm, michael wrote:
Does this mean the bmp images and the wave files ...ect are inserted into the executable ?!!!

Yes, optionally. You can 'embed' such resource files in the EXE such that they are automatically extracted the first time it is run. Of course you can use a 'proper' installer like Inno Setup if you prefer, which will provide more sophisticated options, but when you just need to store some images and wave files etc. the simple LBB capability is useful.

One good use of this feature is to put a program on a website which the end user just has to click on and select 'Run'. Then the browser does all the work behind the scenes, without the user having to worry about manually downloading and installing etc. first.

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: re: endless graphics draws and LBBooster
« Reply #7 on: Sep 10th, 2015, 08:50am »

on Sep 9th, 2015, 3:26pm, michael wrote:
Oh and here is a link to the gxGL library code

I've tried the four demo programs listed at gxGraphicsLibraryHome and they seem to run perfectly in LBB. In fact LBB is well suited to a library such as this because I just needed to add the following line at the end of each of the demo programs:

Code:
'include gxGraphics.bas 

In LB, which has no include capability, I would have needed to copy the library code into each program.

Richard.

User Image
User IP Logged

michael
Guest
xx Re: re: endless graphics draws and LBBooster
« Reply #8 on: Sep 10th, 2015, 09:05am »

That's amazing!! And to think I tried to make a simulated DLL in LB.. Essentially, what you showed me would allow me to make modules for many things.
I would also suppose you would surprise me further and say that LBB could also be used to somehow make a DLL?

User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: re: endless graphics draws and LBBooster
« Reply #9 on: Sep 10th, 2015, 9:17pm »

on Sep 10th, 2015, 09:05am, michael wrote:
I would also suppose you would surprise me further and say that LBB could also be used to somehow make a DLL?

Actually it can't, or at least I've never worked out a way to do it (I'm not sure whether it's theoretically possible or not).

Richard.
User IP Logged

michael
Guest
xx Re: re: endless graphics draws and LBBooster
« Reply #10 on: Sep 11th, 2015, 02:26am »

I tried to make include work in LBB but the program doesn't recognize it. I put it at the end of my main program and then executed it.
Because of the missing program module (subroutines that are separated from the program and saved in a separate .bas file)
I looked at the links concerning it in LBB and I cant figure why it doesn't work.



And a little subject for your amusement:
Quote :"Spheres are really hard to make "
grin
http://canevian.conforums.com/index.cgi?board=Development&action=display&num=1441915542
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: re: endless graphics draws and LBBooster
« Reply #11 on: Sep 11th, 2015, 05:46am »

on Sep 11th, 2015, 02:26am, michael wrote:
I cant figure why it doesn't work.

Most likely reasons:
  1. Not starting in the first column. Unlike a conventional comment, 'include must be at the very beginning of the line.

  2. No CRLF afterwards. If you are putting it at the very end of the program, make sure you have added a newline after the filename.
Richard.
User IP Logged

michael
Guest
xx Re: re: endless graphics draws and LBBooster
« Reply #12 on: Sep 11th, 2015, 07:59am »

Obviously I am doing something wrong.
lets say this is my main program.. I have include at the start of the program: (the program wont run if the sub is put there.)
Code:
'include mytools.bas
nomainwin
 open "The sphere subroutine !!Created by Michael Gallup (free for the public to use)" for graphics_nsb_fs as #1
 #1 "trapclose [quit]"
 #1 "fill black ; home ; down ; north"
'************H***V***S***R***G***B**Dimmer
call sphere 500,500,220,225,240,250,1
call sphere 50,50,25,225,240,250,9
call sphere 100,100,50,200,200,200,4
call sphere 200,200,100,140,200,200,2
wait
[quit]
close #1
end
 

and here is the program it would add to the above code.
I would have saved it as mytools.bas
do you know how it would be corrected?

Also the code bellow would need to be put at the base of the program.
Code:
sub sphere h,v,size,x,c,a,dimmer ' dimmer cannot be more than 24
#1 "place ";h;" ";v
for y=1 to size
#1 "down"
#1 "color ";x;" ";c;" ";a
#1 "size 2"
#1 "circle ";y
#1 "flush"
x=x-dimmer
c=c-dimmer
a=a-dimmer
if x<2 then x=2
if c<2 then c=2
if a<2 then a=2
next y
end sub
 
« Last Edit: Sep 11th, 2015, 08:09am by michael » User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: re: endless graphics draws and LBBooster
« Reply #13 on: Sep 11th, 2015, 10:50am »

'include
doesn't work as a first line.
It is documented in a help file:
Quote:
For maximum compatibility with Liberty BASIC Workshop the 'include directive is ignored when it is at the very beginning of the program. See this Wiki article for more information, and for details of how to integrate LBW with LBB.
User IP Logged

Rod
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 110
xx Re: re: endless graphics draws and LBBooster
« Reply #14 on: Sep 11th, 2015, 5:06pm »

The use of flush in the middle of the loop is not appropriate. If you ran this in LB with a size of 200 then every time the window was moved minimised or restored there would be 200 drawing actions. Perhaps not with LBB but certainly with LB.

Flush should be use sparingly and at the end of a looped or multiplexed drawing routine.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: re: endless graphics draws and LBBooster
« Reply #15 on: Sep 11th, 2015, 5:24pm »

on Sep 11th, 2015, 5:06pm, Rod wrote:
If you ran this in LB with a size of 200 then every time the window was moved minimised or restored there would be 200 drawing actions. Perhaps not with LBB but certainly with LB.

The effect won't be so serious in LBB, but it will certainly slow the program down so it's not a good idea. If you're writing a program to run only in LBB, I would recommend not using FLUSH (although it can still be useful when paired with REDRAW). If you want the code to run in both LB and LBB then use FLUSH but ensure it doesn't result in a memory leak (e.g. using CLS or DELSEGMENT to free the memory).

Richard.
User IP Logged

michael
Guest
xx Re: re: endless graphics draws and LBBooster
« Reply #16 on: Sep 11th, 2015, 5:34pm »

That's fine. It doesn't take me long to copy/paste my main program onto a template.
I will just make a Program generator to merge the files together quickly into a new program.
Because that's what I do best.

I am using LBB just for the fact that it makes stand alone executables and for the fact it allows continuous draws.
I could use the other resources like gxGL and OpenGL and some other method Richard used in old forum posts for 3D magic, but that's a bit over me since I have only been serious on LB since last January 2015..
« Last Edit: Sep 11th, 2015, 5:56pm by michael » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: re: endless graphics draws and LBBooster
« Reply #17 on: Sep 11th, 2015, 8:24pm »

on Sep 11th, 2015, 5:34pm, michael wrote:
I will just make a Program generator to merge the files together quickly into a new program.

Can I just reiterate that 'include works correctly in LBB, as documented. If it serves your purpose (and it's ideal for the gxGraphics library) then use it.

Richard.
User IP Logged

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


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