• Welcome to Jose's Read Only Forum 2023.
 

BassBox Soundscape translation for FreeBasic

Started by Charles Pegge, February 06, 2008, 01:57:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Charles Pegge

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.


Patrice Terrier

--Charles

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

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge

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


Patrice Terrier

#3
--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?

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge


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

Charles Pegge

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


Patrice Terrier

--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

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge

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.

Patrice Terrier

#8
--Charles

When i wrote BassBox i had several ideas in mind:


  • Express my grateful to Jose's work, with something concrete.
  • Demonstrate the supremacy of SDK over anything else.
  • Produce something that would cover the complete process of GUI creation from A-Z.
  • Use this project to create a synergy with other programmers.
  • Show that advanced multimedia programming can be done in full procedural mode.
  • Mixing several Win32 languages altogether.
  • Create a simplified plugin concept easy to understand for anyone familiar with the WinProc style message.
  • Choose a topic that could attract the largest audience with something universel (a media player).
  • Something that could combine artwork and programming skill altogether.
  • Explore some of the new VISTA API.
  • Attract new members to this community, to make it a top notch programming place.

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)  :)

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge

#9

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.

Patrice Terrier

--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.

...


Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge

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.



Patrice Terrier

#12
--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

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge


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

Petr Schreiber

 ;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
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com