Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Xbox 360 controller support

Author
Message
Ninja_Je5us
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 6th Mar 2011 20:52
Hi all,

I have been trying to use the library specially created for the xbox 360 controller to allow you to use it with DarkGDK. This is the one that you can download from exodev.

However, I am having some trouble getting the program to read that a button is being pressed. Here's my code to begin with:



This is not meant to do a lot. Firstly it should print "GamePad" on the screen if there is a gamepad connected and if the A button is pressed on a gamepad it should print "AAA" onto the screen.

It does print gamepad and ive done other tests to show that the program is reading that it is connected but there is no reaction when I press the A key, or any other key that I have tested.

Does anyone have any experience with the use of this library as I am stumped?

Regards
Todd Riggins
20
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 7th Mar 2011 08:52 Edited at: 7th Mar 2011 08:54
Hi Ninja,

You need the function XB360Poll inside your main loop in order to poll for the data from the XInput library.

Try putting

XB360Poll(2);

right above the line:

if(XB360AButton(controller)==1) {

Unfortunately I don't have DarkGDK setup now to test the example you gave. Hopefully the XB360Poll function should give you the desired results.

Also I don't know if you have yet, but take a look at the c++ file "XB360Example1.cpp" in the example directory as it will show you how to use all the commands in there.

Hope that helps...

ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY

Login to post a reply

Server time is: 2024-11-19 12:46:18
Your offset time is: 2024-11-19 12:46:18