IonicWind Software

Aurora Compiler => 3D Graphics => Topic started by: on December 31, 1969, 05:00:00 PM

Poll
Question: Should I post the wrapper on the Blitz Forums?
Option 1: Yes votes: 3
Option 2: No votes: 0
Option 3: Other (Post response) votes: 0
Title: Blitz3D SDK Aurora Plugin
Post by: J B Wood (Zumwalt) on November 27, 2007, 10:38:37 PM
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.
Title: Re: Blitz3D SDK Aurora Plugin
Post by: sapero on November 28, 2007, 02:28:55 AM
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...
Title: Re: Blitz3D SDK Aurora Plugin
Post by: Barney on November 28, 2007, 03:27:05 AM
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.

Barney
Title: Re: Blitz3D SDK Aurora Plugin
Post by: J B Wood (Zumwalt) on November 29, 2007, 07:33:54 AM
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.
-Jonathan

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.
Title: Re: Blitz3D SDK Aurora Plugin
Post by: J B Wood (Zumwalt) on December 18, 2007, 02:14:53 PM
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.
Title: Re: Blitz3D SDK Aurora Plugin
Post by: J B Wood (Zumwalt) on May 13, 2011, 01:56:56 PM
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();
if(test=1)
{
testCube();
// 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
testTron();
}
else
{
print("Sorry, no mojo for ju!");
}
bbEndBlitz3D();
}