DELPHI, DIRECTX AND FORCE FEEDBACK

Started by
14 comments, last by SeiferAlmasy 18 years ago
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 :(
Advertisement
Check this step by step tutorial:


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/Tutorial_4__Using_Force_Feedback.asp
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....
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....

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.
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
and its ok now, finally located clooti FF examples in delphi:)

Thanks to all that have helped once again:)

This topic is closed to new replies.

Advertisement