Game Development Community

Where to define LOG_INPUT ?

by Will Hankinson · in Torque Game Engine · 01/10/2007 (9:01 pm) · 2 replies

I'm working on getting a virtual joystick added to Torque (using PPJoy). My X-Box 360 controller shows up fine, but I can't get the virtual joysticks to appear. I ran an controller-input test program using DirectX and all of them showed up correctly, so (hopefully) this is something on the Torque side.

I see the flag "LOG_INPUT" in a lot of places, but I don't know where to define it. I'd like to turn this on so I can see if any input events are being registered or not. If I just add

#define LOG_INPUT at the top of winDInputDevice.cc, I get an error...


winDInputDevice.obj : error LNK2019: unresolved external symbol "public: static void __cdecl Input::log(char const *,...)" (?log@Input@@SAXPBDZZ) referenced in function "public: bool __thiscall DInputDevice::create(void)" (?create@DInputDevice@@QAE_NXZ)
../example/torqueDemo_DEBUG.exe : fatal error LNK1120: 1 unresolved externals



I'm pretty new to C++...anyone know how to toggle LOG_INPUT on?

#1
01/11/2007 (1:28 am)
Your define is correct and there's nothing wrong to put it at the top of winDInputDevice.cc

The problem is that the functionallity that gets enabled when LOG_INPUT is defined is most likely broken.
#2
01/11/2007 (1:58 pm)
Glad to hear I'm not completely retarded. I eventually decided it would be easier to just remove the debugging features I needed from the #ifdef/#endif blocks and print them to the console instead of a log file.

All that was very helpful in finding out that there's definitely something wonky going on. The two "virtual joysticks" I have added with PPJoy are not recognized by torque...at all. They don't come in as joysticks...there are no unknown objects...they're just not showing up.

I changed some flags in DInputManager::enumerateDevices() to be DIEDFL_ALLDEVICES instead of DIEDFL_ATTACHEDONLY (thinking that the fake joysticks might not be hitting a "device plugged in" switch somewhere), but this didn't solve it either.

I know the joysticks are installed properly (I've tested them in java as well as a joystick-testing program...but a program written with DX7)...has anyone else had strange issues getting input into Torque?