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:
#include "DarkGDK.h"
#include "XB360CL_1_3.h"
#pragma comment (lib, "XB360CL_1_3.lib")
// the main entry point for the application is this function
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetDisplayMode(800, 600, 32);
XB360Init();
int controller;
for(int id = 0; id < 4; id++) {
if(XB360ControllerConnected(id)==1) {
controller = id;
}
}
if(XB360ControllerType(controller)==1) {
dbSetCursor( 400, 350 );
dbPrint("GamePad");
}
while ( LoopGDK ( ) )
{
if(XB360AButton(controller)==1) {
dbSetCursor( 200, 300 );
dbPrint("AAA");
}
dbSync ( );
}
return;
}
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