PB Bindings for GameVision SDK

Just starting out? Need help? Post your questions and find answers here.
jarroddavis
New User
New User
Posts: 7
Joined: Sat May 22, 2004 1:24 pm
Location: USA
Contact:

PB Bindings for GameVision SDK

Post by jarroddavis »

Hi,

I've been getting some requests to provide PB bindings for my 2D rendering API, GameVision SDK. I'm in the process of doing this, but I'm having some problems.

Some of the routines are recognized and some are not. For example, I can call GV_LogFile_Write_(...), but not GV_App_ProcessMessages_(). I've checked the GV.bpl file and it seems ok. It looks like the whole GV_App_XXX family of routines do not work, yet other groups do. How is this possible?

I'm new to Pure Basic so most likely I am doing something wrong. I purchased it about a year ago, but not had a change yet to dive in until now. Any help is appreciated.

I've tried 3.90 and the 3.91 beta.

Here is a link to what I have so far:
http://www.jarroddavis.com/priv/gv_pb_wip.rar (~700KB)

Thanks
Jarrod Davis,
Owner/Lead Developer
Jarrod Davis Software
http://www.jarroddavis.com
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

I have not yet confirmed this, but i think it is because you are ending the functions with a "_" which in Purebasic means it is a API Call.

Try changing their names, so the last character is not the underscore :wink:

This might be the problem...
jarroddavis
New User
New User
Posts: 7
Joined: Sat May 22, 2004 1:24 pm
Location: USA
Contact:

Post by jarroddavis »

Hi,

I used the Dll Importer tool. From what I understand you have to add the "_" to the end of imported routines when used in PB.

All of the routines in the GV.DLL are STDCALL and exported like such:
GV_App_ProcessMessages
GV_LogFile_Write

not like
_GV_App_ProcessMessages@0
_GV_LogFile_Write@1

Mmm.. maybe this could be the problem? The GV.DLL is written in Delphi and it does not add any decerations to the exported routines (see the view.txt file, which is a dump of the gv.dll).

Could this be a problem?
Jarrod Davis,
Owner/Lead Developer
Jarrod Davis Software
http://www.jarroddavis.com
jarroddavis
New User
New User
Posts: 7
Joined: Sat May 22, 2004 1:24 pm
Location: USA
Contact:

Post by jarroddavis »

Seems to be something going on with the dll import tool.

If I import:
GV_App_ProcessMessages 0

and then call this in PB, all is fine. But as soon as I add:
GV_AppWindow_Open 4

to the import list, then any routine that is named GV_App_XXX no longer is avail. What is going on?
Jarrod Davis,
Owner/Lead Developer
Jarrod Davis Software
http://www.jarroddavis.com
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

It might be the compiler and not the dll importer that's at fault. I had a quick look at what the importer had created from your 'gv.exp' file and to me it seemed to be ok.

Maybe someone from the PB team could help you or someone that's more experienced with these things than me.

[edit]
I have investigated/experimented a bit further and it seems to be an error in the compiler. Having the '_' character in a function name somehow screws up the internal list of functions, or it might be that the internal function search routine is faulty?
[/edit]
jarroddavis
New User
New User
Posts: 7
Joined: Sat May 22, 2004 1:24 pm
Location: USA
Contact:

Post by jarroddavis »

I see.

I've started using the CallFunctionFast and begun the painful task of wrapping the 200+ exported routines. :cry:

Can I use LongWords in PB? I need it to pass a window handle that is returned from GV_AppWindow_Handle. Also, GV_Make_Color uses unsigned ints too.
Jarrod Davis,
Owner/Lead Developer
Jarrod Davis Software
http://www.jarroddavis.com
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

Here's a list, made by Freak, of win API types and their corresponding type in PureBasic, which might be of use for you:
http://freak.coolfreepages.com/help/wintypes.zip
jarroddavis
New User
New User
Posts: 7
Joined: Sat May 22, 2004 1:24 pm
Location: USA
Contact:

Post by jarroddavis »

Ok, thanks man.
Jarrod Davis,
Owner/Lead Developer
Jarrod Davis Software
http://www.jarroddavis.com
jarroddavis
New User
New User
Posts: 7
Joined: Sat May 22, 2004 1:24 pm
Location: USA
Contact:

Post by jarroddavis »

Hi,

I just converted the TestBed demo in the GVSDK to PureBasic. It seems to run good. You can download it here:

http://www.jarroddavis.com/priv/gv_pb_testbed.rar

The TestBed demo shows:
* Rendering (textures, Primitives)
* Audio (One shot & Looping Samples, Streaming music)
* Archive (Loading from standard zip files)
* Fonts
* Frame-Based Timing
* Dialog boxes
* Polygons
* Input
* Screen Shot

I had to make a few changes to the GV core so that it could work with PB. The changes are good because they are what are needed to make GV work better with more languages.

I converted a fair amount of the API over to PB. There is still much left to do, but this is a great start. I must say that PureBasic is powerful indeed. :wink:

You need DX9.0b to run this demo.
Jarrod Davis,
Owner/Lead Developer
Jarrod Davis Software
http://www.jarroddavis.com
Post Reply