Using Win32 API

Blitz3D Forums/Blitz3D Programming/Using Win32 API

SkyCube(Posted 2005) [#1]
Hello everyone,

I've noticed that in order to create really good games, many of you use DLL extensions to Blitz3D or access the Win32 API directly from within Blitz. I also noticed that the API definitions are listed in the code archives for kernel32.dll, gdi32.dll and user32.dll. My question is: How do I use these definitions within blitz3d?


TartanTangerine (was Indiepath)(Posted 2005) [#2]
Tell you the truth SkyCube "really good games" have nothing do with Windows or the API or any DLL.

These functions are used to give Blitz extra functionality and perhaps a speed boost in some areas. If you don't know what these functions do then you probably are not going to want to use them.

My Question is: What are you trying to achieve? we can help you in many ways.

Regards,


semar(Posted 2005) [#3]
If you use wisely B3D, you don't really need to use any DLL to make a good game. The programming flexibility delivered from within the Blitz3D command set, gives to you already full power.

The use of DLL is useful when you need perform some task which is not covered by the current command set; but apart of this, you can develop really nice things with Blitz3D, IMO.

Anyway, you use any DLL by declaring in a corrispective .decls file, which should be located under the DECLS directory of your blitz installation, and then access to the declared function from within Blitz. You should run a new IDE to see the changes in a just created decls file.

Look for the examples in the code archive.

Sergio.


Boiled Sweets(Posted 2005) [#4]
I posted the decls there as I wanted to use them to do a particular strange thing (actually it was to get the users desktop colour depth) and thought that they ** MIGHT ** be useful for others but...

I agree with semar, the use of the WIN API is not needed to produce polished pro games. You can do it all with Blitz. It's only when you want to do something 'out of the box', like get the users desktop wallpaper that you need to use WIN API calls.

Typically if you don't know you need them then you don't, you are not missing anything!

But to answer your question. Drop them in your \blitz3d\userlibs directory. Then in your code call them like this for example this sets the desktop wallpaper...

api_SystemParametersInfo(20, 0, gen_screenshot_filename$, 1)

Hope that answers your question.


SkyCube(Posted 2005) [#5]
Hmm,

Thanks for the info everyone. I really don't think I will use the WinAPI until I've learned the Blitz3D core very well (and maybe not even after). But I have seen some good stuff added by using external DLLs. Just the other day I was reading about the Tokamak Physics engine and was very surprised when I downloaded it and it turned out to be a DLL. I have also seen some Blitz GUIs that use DLLs.

I guess I was just curious to see how Blitz3D is extended, but you're right. Perhaps it's better to stay away from the API unless there is no other choice (don't think I'd make anything useful with it anyway).

By the way, is there a good Physics Engine implemented in Blitz3D itself?


Rook Zimbabwe(Posted 2005) [#6]
Yeah... If you need a good GUI I reccomend BlitzUI. Just tossing in my $0.02! : )
-RZ


SkyCube(Posted 2005) [#7]
blitzUI? where can I get it? I haven't seen it in the Tools and libs section.


Naughty Alien(Posted 2005) [#8]
BlitzUI is free and excellent GUI...I'm using it in all my projects and since now, everythings working well...