Skip to main content
GameDev.net gamedev.net
🔒 Locked

managed DirectInput frustrated!!

Started by edwinnie Dec 31, 2003 at 9:00 PM 0 replies 350+ views
Original Post
edwinnie
edwinnie
hihi, i was fiddling around with the action mapping sample, i converted the C# version to a managed C++ version. unfortunately, there are 2 damn weird bugs that i cant seem to address: 1) the first bug occurs at the "genre" when trying to setup the actionformat. consider the following code below:
DIActionFormat->Genre = (int)Microsoft::DirectX::DirectInput::FightingThirdPerson::FightingThirdPerson;
the code above seemed to look correct but it isnt, i tried to let the vs.net 2003 compiler invoke the "look-up" code for each scope operator, until i hit: "Microsoft::DirectX::DirectInput::FightingThirdPerson" the next scope operator should list all the enumerations, but the compiler didnt, and in fact gave a cut list of enumerations, which is VERY annoying (meaning that there was no way i could select the proper enum). 2) secondly, i wonder if this is attributed to the above bug, as i got a runtime error stating that something is "out of range", when trying to enumerate all the input devices by the code below. (and off cux, i converted the c# code to c++.net, and the code is copied from the c# sample) the full code listing of i how try to setup the action format to the enumeration of the input devices:
   
//Guid actionGuid 

actionGuid = Guid("ED48D6E8-91D1-4cf6-9ED3-BB327F76F17D"); 
DIActionFormat = new ActionFormat(); 
DIActionFormat->ActionMapGuid = actionGuid; 


//stupid genre bug 

//DIActionFormat->Genre = (int)Microsoft::DirectX::DirectInput::FightingThirdPerson::FightingThirdPerson; 

   
DIActionFormat->AxisMin = -99; 
DIActionFormat->AxisMax = 99; 
DIActionFormat->BufferSize = 16; 
CreateActionMap(); 


//Enumerate devices according to the action format 

//gave a runtime out of range error 

DeviceList* devList = Manager::GetDevices(DIActionFormat, EnumDevicesBySemanticsFlags::AttachedOnly); 
well thats it. I might switch back to unmanaged DX and using managed C++.net...sighz need some helps... thx! Edwinz [edited by - edwinnie on December 31, 2003 10:02:17 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.