New BLIde Plus BETA available

BlitzMax Forums/BlitzMax Programming/New BLIde Plus BETA available

ziggy(Posted 2008) [#1]
A new BLIde Plus BETA is available to all BLIde Plus users. This new version integrates the creation of DLLs and adds some improvements to intellisense. A short explanation on how to create DLLs using BLIde Plus see this small guide http://www.blide.org/index.php?section=makingdlls

The good news is that this DLL creation feature does not requiere you to make any change to the current official bmk utility. It just works as long as you have MinGW properly installed.

Part of the code used for the DLL creation is based on the Leadwerks Publisher. So, a big thanks to Josh.


Mauft(Posted 2008) [#2]
Interesting, but gives one question though - why use DLLs, when there are modules?
Unless DLLs can also be written for other applications.


plash(Posted 2008) [#3]
Unless DLLs can also be written for other applications.
They most certainly can be.


ziggy(Posted 2008) [#4]
Unless DLLs can also be written for other applications
that's the answer to your own question. :D Also DLLs can be used Microsoft's Visual Studio Express C# or C++ editions, the free DevC++ environment from Bloodshed or alternatively languages such as PureBasic, Delphi or Visual Basic. NET


Mauft(Posted 2008) [#5]
That makes perfect sense. But aren't these DLLs slower than those written in C++? If so that makes their usability a bit smaller if someone strives for maximum optimization.

And another question - can such DLL work as a frontend (not sure if that's proper name) for some other DLL? A stupid (or smart, whichever you think) example - hypothetically make a frontend for Deliplayer DLL to allow XMPlay play, let's say mfp format?

Anyway, this ability sounds nice, though I am not one to use languages other than BMax at the time being :).


ziggy(Posted 2008) [#6]
But aren't these DLLs slower than those written in C++?
DLLs work at the same speed as regular BlitzMax code, wich I think is faster than GNU C++ in some situations, but slower to Visual C++. Real speed will depend on the algorithm more than in the language itself. Obviously managed languages like BlitzMax tend to be slower than unmaged ones becouse of the usage of GC... long story...
A part from this, yes, any DLL can load any other DLL, of course! One of the possible usages of this feature is to encapsulate part of your programs in a dll, so if there's any fix, users only have to update the dll (replace with the new one) to get the fix. Specially used to encapsulate functionallity several of your programs use. So one file update fixes any bug on all of them.


Mauft(Posted 2008) [#7]
to encapsulate part of your programs in a dll, so if there's any fix, users only have to update the dll

That sounds especially interesting! Though it brings one more question - how much slower is it to use DLLs instead of modules? I mean, if I were to, for example, build a game using almost only DLLs, would it be much slower (if any) than a game created using only blitzmax code?
Though I doubt I would ever do such thing. The only thing I think I could use such functionality for my current project is to make Menus, which could be later updated for additional functionality :).


ziggy(Posted 2008) [#8]
It runs at the same speed as modules, you'll just need to 'load' the dll at the begining of the program, wich takes less than 1 millisec.


AlexO(Posted 2008) [#9]
This DLL functionality would seem to be useful if you're writing a game in Blitzmax and wish to write tools (say a map editor using the same rendering routines) in another language like C#. Is that feasible?


ziggy(Posted 2008) [#10]
Yes, of course! This is completelly possible.


Htbaa(Posted 2008) [#11]
I've read it's not possible to "export" your own custom types. So is all I could do is write generic functions? Or is this untrue?


ziggy(Posted 2008) [#12]
you can't export types, but you can export functions that deal with types.


MGE(Posted 2008) [#13]
I'm considering adapting to my game engine to DLL so other languages can interface with it. ;)


Dreamora(Posted 2008) [#14]
In that case its easy
Export TBanks with the size of the data of your object (sizeof(typename))
You can copy the data to the bank through memcopy and also copy it from a bank you got into a created type instance that way.

pretty powerfull if done right, pretty ugly memoryleaks if you forget about the fact that memcopy does not create new references on the objects -> so you need to create and remove them as needed.