Jose's Read Only Forum 2023

IT-Consultant: Charles Pegge => GLSL => Topic started by: Charles Pegge on February 06, 2008, 01:57:45 AM

Title: BassBox Soundscape translation for FreeBasic
Post by: Charles Pegge on February 06, 2008, 01:57:45 AM
This is an unexpurgated version with battle scars left in. I will produce a gift-wrapped version shortly.

It should appear identical to the previous PB version of SoundscapGLSL.

The ZIP file below contains source code only. (Too many square brackets to display here!). There are some notes at the beginning including details of two modifications to BassBox itself.

Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Patrice Terrier on February 06, 2008, 02:17:42 PM
--Charles

Just out of curriosity, do you know what is the meaning/purpose of the decoration added by FreeBasic when dealing with DLL?

...
Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Charles Pegge on February 06, 2008, 03:08:44 PM
This decoration is used by FreeBasic in STDcalls on the Windows platform to tell the compiler how many bytes of parameters are being passed to a function. I understand it is a Microsoft invention and helps to distinguish overloaded functions. ( same name, different parameters). Unfortunately there are many different schemes about:

Article on Name Mangling

http://en.wikipedia.org/wiki/Name_mangling

PE / DLL viewer (Platform independent Online Tool)

http://www.ucware.com/apev/index.htm

Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Patrice Terrier on February 06, 2008, 05:22:31 PM
--Charles

Thank you for the provided links.

Now about FreeBasic, i have never seen any descent or commercial application written with it.
Have you ever seen one yourself?

...
Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Charles Pegge on February 06, 2008, 07:53:29 PM

That is a question I have not really asked myself before in appraising FreeBasic. It has not reached version 1 yet - so it definitely considers itself to be a youngster. There are some 2700 members registered on their Forum and the postings go back to around June 2005. But it has some solid technology behind it, and the  evolution of the language from Qbasic is very impressive.

I've written about 7000 lines of code with it so far, and find it codes very nicely with no major problems, but with new features coming out so rapidly it is hard to keep up.

Quote
It makes use of the GNU binutils programming tools as backends and can produce console and graphical/GUI executables, besides dynamic and static libraries. FreeBASIC fully supports the use of C libraries and partially C++ library support. This allows the programmer to use and also create libraries for C and many other languages.

http://en.wikipedia.org/wiki/FreeBASIC
Title: Re: BassBox Soundscape translation for FB: Patrice
Post by: Charles Pegge on February 07, 2008, 10:24:35 PM
Patrice, Good News!

With some help from the FreeBasic Forums We do not have to worry about @4 decorations any more.

In FB to suppress the decorations the solution is to enclose the whole BBProc in an Extern block like this:


Extern
Extern "Windows-MS"
'// The main exported plugin's function would be bbProc, like this:
FUNCTION BBProc (byref  BBP AS BBPLUGIN) AS integer export
.....
End Function
End Extern

Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Patrice Terrier on February 08, 2008, 10:57:06 AM
--Charles

Fine thank you.

Now, the problem is: would you find someone (except you) to write new bassBox plugins with FB  ;)

If you think yes, then go ahead posting on FB's forum and let's see  :o

Cordialy

...

Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Charles Pegge on February 08, 2008, 11:29:55 AM
I am warming to the challenge Patrice. The first thing is to get acquainted with the Freebasic Forum and its groups. The obvious choice is GameDev but anyone into computer graphics might take an interest  But the technically minded might want to dismantle BassBox and use the parts for their own projects :). There is a wealth of technology, you have put together in this project.

Would you be interested in doing C++ Plugins? That might attract more interest in Code Project.
Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Patrice Terrier on February 08, 2008, 03:15:17 PM
--Charles

When i wrote BassBox i had several ideas in mind:


All that being said, i have developed BassBox with the same rigour as i would have done for a paid job, spending three full monthes work on it.

QuoteBut the technically minded might want to dismantle BassBox and use the parts for their own projects
Now that the project has grown up to reach maturity, i am waiting to see if it would arouse new vocations, or just being used for (see your quote)  :)

...
Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Charles Pegge on February 08, 2008, 03:44:08 PM

Updated to remove FreeImage dependency

Here is the cleaned up source code and DLL compiled with FreeBasic 0.18.3. The shader folder is also included, but no changes have been made apart from turning a 6 into a 6.0 on the final statement in the fragment shader. This is to placate the irritable GLSL Validator.

It should appear immediately to the right of the PB compiled version in the line of Plugins, looking and performing the same. The code is about 7k larger than the PB version at around 50K.


PS: Thank you Patrice. I hope this will help to propagate the project and achieve some of those objectives.
Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Patrice Terrier on February 08, 2008, 06:05:02 PM
--Charles

The SoundscapeGLSLf.dll requires the freeimage.dll that is not provided with BassBox, thus causing havoc on system without it.

Better to stay with GDIPLUS that is a standard DLL on both XP and VISTA.

...


Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Charles Pegge on February 08, 2008, 07:21:41 PM
Yes sorry about that. If you would  like to download it again, I have removed the FreeImage dependency. So it uses only GDIplus.

The source code contains functions for both alternatives.


Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Patrice Terrier on February 08, 2008, 07:46:20 PM
--Charles

Feedback:
the FB plugin version works fine on VISTA.

Perhaps the rookies (and also the old dogs) will be intimidated to see it coded in ASM  ;D

...
Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Charles Pegge on February 08, 2008, 11:01:46 PM

Well it is quite feasible to do nearly all of it in Inline assembler. It does get rather lengthy though - about 4000 lines on this plugin. FreeBasic emits assembler during compilation to the 'GAS' assembler to generate executable code. - so it's assembler facilities are a bit more developed than PB's. For instance it is possible  to call external (dll) functions directly, as well as internal functions and labels.

I wonder why it's called GAS and not GASM  ;D
Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Petr Schreiber on February 08, 2008, 11:59:48 PM
 ;D

Charles,

how can you see the assembly output from FreeBASIC?
I find FreeBASIC interesting, although for now PB is more than enough for me :)


Thanks,
Petr
Title: Re: BassBox Soundscape translation for FreeBasic
Post by: Charles Pegge on February 09, 2008, 05:09:57 AM

Assembler source is always generated by the compiler. You can prevent it from being deleted with the -r switch. At the console the compiler is invoked like this:

fbc -r -dylib SoundscapeGLSLf.bas

To get a listing of all the compiler options:

fbc

It's quite interesting to view the asm file. For things like Opengl, and general SDK coding,  the assembler looks really simple. The Basic itself does not introduce any baggage so there is little to be gained by writing one's own assembler for these sections of code.