• Advertisement
Sign in to follow this  

DELPHI, DIRECTX AND FORCE FEEDBACK

This topic is 4334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This will prob. be the last tiem I enquire about this particular problem. I have tried my hardest to get soem information elsewhere but no luck. I have been told I need to download Directx headers or SDK? I have no idea where to get it (I use delphi 4) , how to install it or how to use it. Delphix (force feedback) doesn't seem to work at all with USB controllers and I am told that using API comamnds can do it. Unfortunately I have no idea has said how to do it. All I need is code that will initiate a short 1 second burst of rumble on joypads with force feedback support. Actually I have yet to see any joypad work with Directx force feedback. Its incredible that after all this time noone seems to ahve fixed the issue..but its free so I shouldn't moan Thanks

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
bump

Share this post


Link to post
Share on other sites
DirectX headers : http://www.clootie.ru/delphi/index.html
If you need to use Directinput: directinput.pas, I have it if you need it.
just put the .pas files in your game directory. Also the DLL's.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thankyou very much...and now since I have absolutely no idea how to use the API's have you a snippit of code there that could invoke a 0.5 second cinstant ruble effect on my joypad?

I know this is asking you to do everything for me but I have absolutely no idea where to start :)

Thanks

Share this post


Link to post
Share on other sites
Oh yeah also, I will need only code and pas files that are actually needed to make the rumble effect possible. So if I need Directinput.pas please send it (i thought it came with the jedi headers?)

Share this post


Link to post
Share on other sites
A simple Google of 'direct input delphi' returns several places you can download the DirectX SDK for Delphi (which you will need all of).

Share this post


Link to post
Share on other sites
Yeah I now have them, sadly its like buying a pair of trainers if you don't know what they are for. I need examples of actual code that invokes force feedback. I have searched all over google , each time nothing except a reference to buying a book which would probably stil not help me.

Does anyone have a snall section of code that will make rumble work? I am also in discussion witht he undelphix creators etc, in the hope they can fix the lack of support for usb controllers in delphix

Share this post


Link to post
Share on other sites
I suppose a quicker idea would be if anyone knows why my USB controller isn't woring with forcefeedback with delphix?

Just curious, is there ANYONE here who has force feedback working with delphix?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You should ask in the forum for this web site:

http://www.pascalgamedevelopment.com/

There are a lot people there who used to use delphix.

Suggest: if you search in google sample code about force feedback you should not include "delphi" or "pascal" word as part of your citeria, this will give you sample code in C++ and VB (which is more commun to found), the directx commands and parameters are the same whatever language programming you are using so it should be enough to help you to implement the same in delphi language. If you are just looking where to copy/paste code then it is a litle more difficult.


good luck.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://www.paradoxalpress.com/Docs/DX9_out/Creating_an_Effect.htm

does that look correct for C++ etc?

Cause even though I have the headers in delphi installed, I don't have a clue where abouts to insert it :(

Share this post


Link to post
Share on other sites
http://www.paradoxalpress.com/Docs/DX9_out/Creating_an_Effect.htm

does that look correct for C++ etc?

Cause even though I have the headers in delphi installed, I don't have a clue where abouts to insert it :(

Share this post


Link to post
Share on other sites
Now you see, thats probably the right thing, thanks!

Only prob is I don't know if that will go straight into delphi like it is..and if it does or doesn't I have no way of knowing where to shove it in the code....

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Only prob is I don't know if that will go straight into delphi like it is..and if it does or doesn't I have no way of knowing where to shove it in the code....[/QUOTE]

Come on!, you have to learn what the api does/returns; and what the parameters are;it is very well explained in that tutorial;

It is not mean to be a line-by-line C++ to delphi translation code.

For example, first step: Enumerating force-feedback device; mean you need to check first if the user has one instaled:

//------------------------------------------
LPDIRECTINPUTDEVICE8 g_lpDIDevice = NULL;

hr = g_lpDI->EnumDevices(DI8DEVCLASS_GAMECTRL,
DIEnumDevicesProc,
NULL,
DIEDFL_FORCEFEEDBACK | DIEDFL_ATTACHEDONLY);
if (FAILED(hr))
{
// No force-feedback joystick available; take appropriate action.
}
//---------------------------------------

In your delphi units check the DIRECTINPUTDEVICE8 class and looks for the EnumDevices method so you known the delphi result and parameters data type you use with that; of course i guess you have to create the class before using.

tp.

Share this post


Link to post
Share on other sites
If you would have read my other comments you would have realised that I am a novice. Using API's is not easy for a beginner (esking me to change it from C++ looking code to delphi is just not gonna happen for me unless I can somehow get to uni and study for 5 years) and it is not very hard for an expert to give me a complete short example as a delphi .dpr project or complete code to invoke a short 0.5sec constant force feedback effect on a joypad.

In the same way, if you came to me saying that you knew nothing about concrete but needed some anyway, I wouldn't tell you to go learn the mixture.

I don't think you appreciate how hard programming is to someone who has not studies it as a university student or as an advanced student of kinds. I am pretty fortunate that I was able to do what I have so far with my limited programming knowledge.

Please don't come back saying "well what you doing here?" or "Well its for experts" because its nonsense to suggest that with the complete code I mentioned I cannot put it into my project...because with the Jedi headers now installed, its of course 100% possible.

You being an expert, I gues it would take you next to no time at all.

DLPB

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement