Page 1 of 1
PureBasic Bindings for GameVision SDK 2
Posted: Wed Nov 17, 2004 7:09 am
by BigDaddy
Hello,
We made PB bindings for the
GameVision SDK 2, a 2D rendering API for PC's running Microsoft Windows. This release is aimed specifically at Direct3D with 3D hardware. The GameVision SDK is feature complete and can easily create any type of 2D game with D3D for rendering. GameVision 1.x powered our game FreeStrike 1.x. GV was designed to be easy to use, robust and feature rich and should be easy to use in your projects.
You can download the beta PB bindings here:
http://www.bigdaddygames.com/temp/gvsdk2_pb.zip (752KB) [PB 3.9x]
We hope to have official PB bindings plus examples in the next GVSDK2 update.
Visit the
Big Daddy Games web site for more information about GVSDK2.
Best Regards,
Jarrod Davis
CEO/Lead Developer
Big Daddy Games, Inc.
support@bigdaddygames.com
www.bigdaddygames.com
Posted: Thu Nov 18, 2004 3:38 am
by BigDaddy
How can I represent this type of structure in PB?
Code: Select all
/* GV_Vector - C/C++*/
typedef struct GV_Vector {
union {
struct { int iX, iY, iZ; };
struct { unsigned int cX, cY, cZ; };
struct { float sX, sY, sZ; };
struct { double dX, dY, dZ; };
};
} GV_Vector, *GV_pVector;
Thanks.
Jarrod
Posted: Thu Nov 18, 2004 4:53 am
by Dare2
I don't know how C++ structures work.
However if you want all four included structures to share the same space (offset zero for each) then:
Code: Select all
Structure one
iX.l
iY.l
iZ.l
Endstructure
Structure two
cX.l
cY.l
cZ.l
Endstructure
Structure three
sX.f
sY.f
sZ.f
Endstructure
Structure four
dX.f
dY.f
dZ.f
Endstructure
; GV_Vector - C/C++
Structure GV_Vector
StructureUnion {
sA.one
sB.two
sC.three
sD.four
EndStructureUnion
EndStructure
If not (they are to be contiguous, which I assume) then
Code: Select all
; GV_Vector - C/C++
Structure GV_Vector
sA.one
sB.two
sC.three
sD.four
EndStructure
Above assumes int is long (4 bytes) and float is single precision (4 bytes). If double is an eight byte float then there is a problem as PB limits itself to 4 byte floats. I don't know of a way to get an unsigned long integer in PB. To get an unsigned word (2 byte) access using
var =GV_Vector\SB\cX & $FFFF
Finally, if I am off track or talking cr@p, someone smarter than I will come along and correct the above.
PS: I typed that in directly, it is not cut and paste so may have typos or other errors.
Posted: Thu Nov 18, 2004 2:57 pm
by BigDaddy
Coolness.
Thanks
Jarrod
Posted: Sat Nov 20, 2004 4:03 am
by BigDaddy
Hi,
In GVSDK2, all exported routines use the STDCALL calling convention including all callback types. For example, I am currently working on making PB bindings for our ScriptVision SDK 2 (complete scripting using a modified version of lua wrapped in an easy to use API) and it defines a few callbacks that are needed for the advanced features such as debugging and error handling.
Can PB call a callback routine that uses the STDCALL calling convention?
Thanks
Jarrod
Posted: Sat Nov 20, 2004 10:06 am
by WolfgangS
BigDaddy wrote:
Can PB call a callback routine that uses the STDCALL calling convention?
Try CallFunction(). If it doesn't work try CallCFunction()
MFG
WolfgangS
Posted: Sat Nov 20, 2004 1:58 pm
by BigDaddy
Hi,
The dll will call a routine that you have defined in PB. For example:
SV_SetErrorProc(@MyErrorProc);
The dll expects this routine to use STDCALL and will be called on an error in script.
Thanks
Jarrod
Posted: Sat Nov 20, 2004 4:33 pm
by Moonshine
PB's Callfunction() command uses STDCALL, CallCFunction() uses CDECL convention.
Posted: Sat Nov 20, 2004 10:38 pm
by BigDaddy
Hi,
Yes I understand, but what I am wondering however is that when I define a function in PB does it use STDCALL by default? Once I set the callback, the dll itself will call the routine automatically, which will expect it to be in STDCALL form.
In C/C++ or Delph I can do this:
// c/c++
void __stdcall MyErrorProc(void); // will use stdcall
// delphi
procedure MyErrorProc; stdcall; // will use stdcall
Then when I call SV_SetErrorProc(MyErrorProc) this will define a error callback that the dll will call automatically when it encounters an error. So, I guess what I am asking then is how do I declare a routine to use a specific calling convention in PB?
Posted: Sun Nov 21, 2004 2:05 am
by Megaborsti
I think PB procedures use STDCALL by default, because PB´s CallFunction() uses STDCALL and you can call the PB procedures of your own code with CallFunction() without loading an external dll

. Think about it

Posted: Tue Jun 27, 2006 11:10 pm
by blueapples
Does anyone have this file? The site is gone and I'm looking for a Lua library for Delphi and PB...
Posted: Tue Jun 27, 2006 11:16 pm
by Shannara
Domain doesnt really exists, only provides search results for the domain and lots of spam and popups ....
Posted: Wed Jun 28, 2006 12:09 am
by White Eagle
Another game engine bites the dust
