USB support for Gamestudio

Posted By: virror

USB support for Gamestudio - 10/18/08 14:50

Hello, i wonder if its possible to use the D2XX USB driver from www.ftdichip.com in 3D Gamestudio to get USB support? Its only a dll file and a .h file that contains functions for USB connectivity. Is it possible to use any dll file in 3D Gamestudio?
Posted By: lostclimate

Re: USB support for Gamestudio - 10/18/08 15:32

depends, you might need to write a wrapper for it, but ultimately no matter what you can get it to work, you just might need to know w little c++ to do it.
Posted By: NITRO777

Re: USB support for Gamestudio - 10/18/08 16:02

Quote:
you might need to write a wrapper for it
What is a wrapper? And how do you write one in c++?
Posted By: lostclimate

Re: USB support for Gamestudio - 10/18/08 16:26

well, if a program needs a specific setup in a dll, then you can write a seperate dll to be a "middle man" which speaks with both the engine and the desired library. Its the type of thing that people have been doing with enet and fmod.
Posted By: NITRO777

Re: USB support for Gamestudio - 10/18/08 16:44

OK, that question is answered...still doesnt tell me exactly how they are written, but I guess I will find that out as I study c++. Now for another question : why would anyone need USB connectivity for gstudio? I thought usb was a protocol for peripheral devices on a computer,...I am having a hard time seeing the link between gstudio...I mean, my mouse is usb and is working fine in the engine. wink
Posted By: virror

Re: USB support for Gamestudio - 10/18/08 17:24

First, this dll works fine with for example Borland C++ Builder without any wrapper, does that make it more likely to work with 3dGS?

Second, im a hardware engeineer, and i would like to build some cool input unit to 3dGS, like a VR glove or something.
Posted By: Quad

Re: USB support for Gamestudio - 10/18/08 18:28

Originally Posted By: virror
First, this dll works fine with for example Borland C++ Builder without any wrapper, does that make it more likely to work with 3dGS?

Second, im a hardware engeineer, and i would like to build some cool input unit to 3dGS, like a VR glove or something.


this sounds interesting. Running this dll inside 3dgs should be possible. If it is c dll it most likely to run directly, but if it is not you'll need a wrapper. Doesn't sound hard....
Posted By: NITRO777

Re: USB support for Gamestudio - 10/18/08 18:57

Quote:
If it is c dll it most likely to run directly, but if it is not you'll need a wrapper. Doesn't sound hard....
Why is that? Is it because gstudio is programmed in c therefore it is the native language?
Posted By: virror

Re: USB support for Gamestudio - 10/18/08 20:11

Sounds promesing, i will post the .h file and the dll below if anyone want to look at it and tell me if its possible. I have some strange include problem right no so i cant test it myself.

ftd2xx.h
ftd2xx.dll
Posted By: Quad

Re: USB support for Gamestudio - 10/18/08 23:03

this will need a wrapper i guess, looks like someone with experience in plugins can easily write a wrapper.
Posted By: virror

Re: USB support for Gamestudio - 10/19/08 17:04

Ok, thanx. Anyone willing to write at wrapper for the dll for me?
That would be great!
Posted By: kasimir

Re: USB support for Gamestudio - 12/06/09 15:39

that would be great, i need this too...

actual i try to modifiy the original header "ftd2xx.h" to get it work.

I replaced:
enum with seperate "counting"-defines
PVOID witdh "void*" -> "typedef void* FT_HANDLE;"

and added:
typedef void *PVOID;
typedef char UCHAR;

now i try to change the rest - but i can not find a solution!
how can i replace this - so 3dgs can work with it?

Code:
typedef void (*PFT_EVENT_HANDLER)(DWORD,DWORD);


(i do not know what "PFT_EVENT_HANDLER" means - no search results)

and the API-functions?:
Code:
FTD2XX_API FT_STATUS WINAPI FT_Close( FT_HANDLE ftHandle );


here i do not know hot i should handle with FT_STATUS and WINAPI -> very confusion

and last but not least:
Code:
typedef struct ft_program_data {
....
} FT_PROGRAM_DATA, *PFT_PROGRAM_DATA;



i would be nice if anyone can give me a hind?

THX Kasimir
Posted By: The_Clyde

Re: USB support for Gamestudio - 12/08/09 07:55

Ahh, I got the Powerglove to work with Gamestudio... I used a microcontroller to send serial data (via USB) based on the readings from the flex-sensors. Then I used a program called PPJoy to read that serial input and have it automatically converted to data from a "virtual joystick".

This input could then be read in Gamestudio the same way as a joystick
© 2024 lite-C Forums