October 06, 2022, 09:06:19 PM


Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........

Blitz3D SDK Aurora Plugin

Started by J B Wood (Zumwalt), November 27, 2007, 10:38:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Should I post the wrapper on the Blitz Forums?

3 (100%)
0 (0%)
Other (Post response)
0 (0%)

Total Members Voted: 3

Voting closed: December 30, 2007, 08:22:03 PM

J B Wood (Zumwalt)

November 27, 2007, 10:38:37 PM Last Edit: November 30, 2007, 05:43:26 PM by Jonathan (zumwalt) Wood
V1.00 Compliant

Ok, first off, I will not distribute the b3d.dll here, you have to go buy the SDK if you want the DLL, there are license restrictions to it or I would post the needed dll here, basically with this conversion, you can now use Blitz3D's SDK to write games in Aurora.
Attached though you will find the source and include file needed to create this beautiful picture.. Anyway, I hope those of you who do have the SDK will find this useful. I know I have :), only 2 methods are not wrapped and that is do to my limited knowledge of callbacks, I get some of it, but those 2 have thrown me off. Maybe this week I will wrap them also, maybe not.


bbSetBlitz3DDebugCallback(void (*callback)(CONST char *));
Declares imported function with cdecl function pointer parameter. The cdecl function takes one parameter char* and returns nothing (void)
I would define it as
DECLARE CDECL import,bbSetBlitz3DDebugCallback(int sub_b3dDebugCallback);
declare cdecl b3dDebugCallback(string *message); // custom function name
// sub b3dDebugCallback(string *message)

The second one takes more parameters:
DECLARE CDECL import,bbSetBlitz3DEventCallback(int sub_b3dEventCallback);
declare cdecl b3dEventCallback(int hwnd,int msg,int wparam,int lparam),int; // custom function name
// sub b3dEventCallback(int hwnd,int msg,int wparam,int lparam),int

So, if you see x(*y)(z) as function/method/structure parameter, this is a function pointer. The function is cdecl by default, but if here is one of CALLBACK, __stdcall, PASCAL or WINAPI, the callback function is stdcall. CALLBACK, PASCAL and WINAPI is a typedef for __stdcall on Windows platforms...


Johnatan, is your wrapper for the latest 1.02 version of the SDK? It has been released last night and I am updating Emergence include. Should be available soon.


J B Wood (Zumwalt)

November 29, 2007, 07:33:54 AM #3 Last Edit: November 30, 2007, 07:57:54 PM by Jonathan (zumwalt) Wood
The wrapper works with 1.02 of the engine.
I will post an update this weekend to include the 2 debug updates that sapero posted the code in this thread for, until then just copy/paste what he posted into the INC file.

I will also double check all the methods in the INC against the 1.02 to verify any changes made between 1.00 and 1.02 of the SDK.

EDIT, attached is the V1.02 compliant
Change Log: Added all new methods to 1.02, updated the Debug methods based on Sapero's suggestion, added in all the defaults on optional parameters.

Included in the B3DSDK.Src file of mine altered to include 4 more demos, which is the insaner and the teapot and the dragon and tron, you must have the SDK's media to see the results, you have to place the media folder under your projects application folder or alter the code to know where to look for the media. Screen shot of the teapot in action and the dragon in his little cubed room.

J B Wood (Zumwalt)

I have posted a link for people to be able to get the plugin on the Blitz3D forums also under there wrappers section.
I have also created a plugins area on my wiki and discussed it a little there also providing a link to be able to download it.

J B Wood (Zumwalt)

Version 1.05 compliant, this is just my source and include files, the soruce, if you do not have the files needed and a media folder setup, the only code that will work is the tron code, so you can remark out the rest in the source, example:

global sub main( )
int test=bbBeginBlitz3D();
// WARNING: for the following to work, you MUST copy the media folder
// that comes with the BLITZ3D SDK to your project folder!!!
//testInsaner(); // won't work without demo files from blitz
//teapottest(); // won't work without demo files from blitz
//dragonTest(); // won't work without demo files from blitz
print("Sorry, no mojo for ju!");