GPWiki.org
GPWiki.org
It is currently Wed May 22, 2013 9:52 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Mon Nov 28, 2011 2:17 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1551
Location: burrowed
Hey, i'm currently trying to add gamepad support.
I don't want to rely on directx/xna so i was looking for a native approach. i found joyGetPosEx() and there's a bunch of examples how to p/invoke it correctly.

http://stackoverflow.com/questions/4416 ... ey-capture // Instructions
http://msdn.microsoft.com/en-us/library/dd757108.aspx // Method documentation
http://msdn.microsoft.com/en-us/library/dd757112.aspx // JOYINFOEX structure documentation

http://codepaste.net/tpmgas // My own code paste

The method returns 0, so no error is occuring. Axis info is correctly read into the struct and it's getting displayed accordingly.
However, there is no button info whatsoever.

The windows joystick configuration window recognizes the gamepad alright and the buttons work in the interface there, s the gamepad works fine.

Any ideas on what the problem might be?

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Wed Nov 30, 2011 4:38 pm 
Mumbo Jumbo
User avatar

Joined: Fri Aug 20, 2004 1:15 pm
Posts: 804
Location: Michigan, USA
Why the heck didn't they include support for windows gamepads in XNA? Very irresponsible.

I found this link that may help:
http://forums.create.msdn.com/forums/t/45983.aspx

_________________
The path to hell is paved with clever code.


Top
 Profile  
 
PostPosted: Wed Nov 30, 2011 4:48 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1551
Location: burrowed
Thanks, but that is dependant on directx/xna. Since i'm not utilizing those libs in my engine, i would rather not resort to that option :|

Gamepad/joystick support seem rather terrible natively on windows.. weird

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Wed Nov 30, 2011 5:30 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1551
Location: burrowed
I finally found the problem!
The dwflag was not set properly(JOY_RETURNALL) so the button data was not returned.

The values can be found here
http://perforce.openwatcom.org:4000/@md ... msystem.mh

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Wed Nov 30, 2011 7:17 pm 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11182
Location: Abingdon, MD
Moglor wrote:
Why the heck didn't they include support for windows gamepads in XNA? Very irresponsible.

Not at all. XNA isn't a generic framework. It's meant to be more Xbox than anything else and since Xbox controllers work on the PC... :P

_________________
Bored? Head on over to my blog and see what I'm up to.

Microsoft XNA MVP


Top
 Profile  
 
PostPosted: Wed Nov 30, 2011 7:22 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1551
Location: burrowed
Machaira wrote:
Moglor wrote:
Why the heck didn't they include support for windows gamepads in XNA? Very irresponsible.

Not at all. XNA isn't a generic framework. It's meant to be more Xbox than anything else and since Xbox controllers work on the PC... :P


Still kind of sad, since a lot of (commercial) windows only projects exist.
Anyways, winmm.dll finally utilized. Gamepad hoooooo

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Sat Dec 31, 2011 4:26 am 
Grand Optimizer
User avatar

Joined: Mon Jan 17, 2005 6:01 pm
Posts: 352
Location: Canada
Machaira wrote:
Moglor wrote:
Why the heck didn't they include support for windows gamepads in XNA? Very irresponsible.

Not at all. XNA isn't a generic framework. It's meant to be more Xbox than anything else and since Xbox controllers work on the PC... :P


They sure do! I added xbox controller support for Tankz just this morning. Including rumble! Works nice :)

_________________
"None are more hopelessly enslaved than those who falsely believe they are free."
"It is no measure of health to be well adjusted to a profoundly sick society."
"Hope is the first step on the road to dissapointment." -Jonah Orion
http://tankzgame.blogspot.com


Top
 Profile  
 
PostPosted: Sat Dec 31, 2011 1:03 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1551
Location: burrowed
yeah, since you're using xbox controllers, of course it is working! That was the whole point of it.
not everyone has one of those, or even likes them all that much. i much prefer using the ps2, or any controller above it so xna would just not work out for me :P

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Sat Jan 07, 2012 1:15 am 
Grand Optimizer
User avatar

Joined: Mon Jan 17, 2005 6:01 pm
Posts: 352
Location: Canada
Really?

I was used to a PS3 controller over at my friend's place.. when i saw the XBOX controller, i figured i wouldn't like it, wouldn't find it comfortable.. but infact, i find it 10x more intuitive/comfortable than the PS3 controller. There's no way I would go back.

And in terms of just gaming.. buying that controller has seriously made my computer more fun. I sit on my comfy chairs infront of my 42" LCD screen and play games with a controller as though i was playing XBOX (Except with all the quality/graphics options that come from playing on PC).. best of both worlds, baybee!

_________________
"None are more hopelessly enslaved than those who falsely believe they are free."
"It is no measure of health to be well adjusted to a profoundly sick society."
"Hope is the first step on the road to dissapointment." -Jonah Orion
http://tankzgame.blogspot.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group