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 1678 times)
michael
Guest
xx re: endless graphics draws and LBBooster
« Thread started on: Sep 9th, 2015, 08:44am »

I just found this forum. Thanks for the information and the link 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 #1 on: Sep 9th, 2015, 10:33am »

on Sep 9th, 2015, 08:44am, michael wrote:
Thanks for the information and the link Richard.

LB4's 'segmented' graphics are the cause of much grief. Whilst occasionally useful, far more commonly they result in unwanted side-effects such as windows that are not redrawn when uncovered (or restored from being minimized), or excessive memory usage. These effects are avoidable, but only at the expense of some complication and only if you are aware of there being a problem in the first place!

So it was an early design decision that LBB would use a more conventional double-buffered approach, whereby graphics are initially drawn onto an off-screen memory surface and then 'blitted' to the screen when required. Not only does this solve both problems, but it is an architecture that Windows is specifically designed to support (with API functions such as GetBoundsRect, InvalidateRect and BitBlt).

Despite this significantly different internal architecture, LBB is compatible with the vast majority of LB graphics programs. This is helped by the fact that FLUSH and REDRAW are implemented in LBB, albeit that they do something rather different from what they do in LB (see the LBB Help docs).

For those few graphics programs which are incompatible there are usually straightforward workarounds to allow them to run in LBB.

Richard.
User IP Logged

michael
Guest
xx Re: re: endless graphics draws and LBBooster
« Reply #2 on: Sep 9th, 2015, 2:47pm »

Liberty Basic did have options like the gx libraries and OpenGL resources. Of course I wanted to just focus on the base graphics for my experiments.
Finding the options out now makes it so I need to modify my simulated 3D image tools to gxGL so I can step out to the "blitter" as they worded it.

My question though is, are the gx libraries and the OpenGL resource 100% compatible with Liberty basic booster?
Oh, and (since I do see there is a mention of LBB enhancements) does LBB have a way of extracting the color value of a pixel with perhaps a one command request?

« Last Edit: Sep 9th, 2015, 2:58pm 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 #3 on: Sep 9th, 2015, 3:20pm »

on Sep 9th, 2015, 2:47pm, michael wrote:
My question though is, are the gx libraries and the OpenGL resource 100% compatible with Liberty basic booster?

I'm afraid I don't know what the 'gx libraries' are so I can't help you there, perhaps somebody else can. As far as OpenGL is concerned that is definitely compatible with LBB, as the author of Cabinet Planner can I think confirm!

Quote:
does LBB have a way of extracting the color value of a pixel with perhaps a one command request?

Nothing additional to what LB provides (i.e. calling the GetPixel API), no. Even if LBB were to provide such a function it would not necessarily be any faster, since it would need to call GetPixel internally and that's a fairly slow API.

Richard.
User IP Logged

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

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