Like I said, it detects the force feedback abilities, but I think it is the autocenter part, that is not working correctly. Because the assigned effect is not playing.
Printable View
Like I said, it detects the force feedback abilities, but I think it is the autocenter part, that is not working correctly. Because the assigned effect is not playing.
Hi Mike,
I will study more your sources later because I have to go out right now but just to give you little advices (not related to the problem you are facing).
1.
To zero fill a structure you can use RESET Power Basic keyword instead of using ZeroMemoryAPI API function.
2.
avoid globals when possible. Defining local variables or full structures is really fast in Power Basic even if executed thousands of times per seconds.
So instead to RESET a global structure used by many functions, declare structures locally in the function. Power Basic will RESET them for you every time avoiding the need to call a RESET or a ZeroMemory fill operation.
Of course if you need a global to share info among different functions, it is ok. But if it is only to reuse it, better go local.
3.
thinBasic interface: instead of using
[code=thinbasic]
If thinBasic_CheckOpenParens() Then
thinBasic_ParseNumber efID
If thinBasic_CheckCloseParens() Then
...
[/code]
you can do it in one line using:
[code=thinbasic]
efID = thinBasic_Parse1NumberAndParens
[/code]
or with more variables...
[code=thinbasic] If thinBasic_CheckOpenParens() Then
thinBasic_ParseNumber minT
If thinBasic_CheckComma() Then
thinBasic_ParseNumber maxT
If thinBasic_CheckCloseParens() Then
...
[/code]
to
[code=thinbasic] thinBasic_Parse2NumbersAndParens(minT, maxT)
[/code]
There are also other thinBasic_Parse* functions in thinCore.inc up to 6 parameters.
I will check your code again later. I'm not an expert on DI but at least I can see if I find any Power Basic related problem.
Ciao
Eros
Guys, as some of you are also in the market, I found this nice article about current gamepads.
I will go out tomorrow and start looking to see if the stores here have it in stock.
http://compactiongames.about.com/od/...p/gamepads.htm
I used to have a generic no name gamepad I bought for $9, that worked well. I then bought a microsoft game pad as well as joystick and those things you could use for years. Very durable.
It looks like they really like the logitech wireless. My friend Josh has one in South Carolina and he says he loves it. So I will look for that.
Last chance to tell me any other good recommendations :)
Sorry, can't help here. I have a Microsoft sidewinder Force feedback 2 joystick and a regular Saitek P880 Gamepad without FF.
LAst night I played more with it and at least I get the interfaces called now that I wanted to. I made my own GUID structure and that way it worked better. Here is the updated DINput include and the lib source. Sorry that it is a little messy now but I will clean it up over the time. I hope I get this FF thing going, I would really love to.
Ok, I found the little bugger I think.
SetCoorperativeLevel needs a dialog/window handler. And I don't know it at the time I initialize directinput.
Any ideas?
Give TBDI_INIT to user to be called after window is created :)
Ok, I talked to Eros, and there is no way to initialize the module for ForceFeedback without having the window handle from TBGL. So I will first install TBDI_Init again. After all the testing is done and the lib is pratically final, we should talk about if it would be a positive mode to integrate TBDI functionality into TBGL. This way TBGL could initialize TBDI when it creates a window.
Dooo, that was it. ::) This damn window handle did the trick. And now a BIG YEAH!!!!!
I managed it. My sidewinder is jumping like a nutcase ;D ;D ;D
Gues... expect ForceFeedback comming to your local thinbasic installation within the next days .
Man I feel like a little kid. Outside is great weather, my son is going to a birthday party soon and I will go for a long walk with my wife. What a sunday. YIPPIE!!! ;D
WOW, thanks. We want to see an example soon. Tomorrow I will get my new toy (Joystick with FF)
This gave me a nice idea to add inter module communications. Still to understand how but should not be so difficult.Quote:
Originally Posted by MikeHart
Maybe you will have to add a new exported function in your module able to get info from other module. Something like
[code=thinbasic]ModuleMessages(ModuleSource, ModuleTarget, Message, Param1, Param2, param3) as long[/code]where
ModuleSource="TBGL"
ModuleTarget="TBDI"
Message = Get..., Set... something
some parameters
and a return value
thinCore will take care to call this function from the target module (if loaded) passing all needed parameters and returning data to source module.
Just an idea.