Hello!
Im a Java hobbyer and I have a fresh start with LWJGL.
I know for this, this is known fact, there are many games out there, with gamepad support and without caliberation of gamepads ??
Next i show my code, my question is to, on what direction i should be developing my code, as i have a goal of a game without a gamepad caliberations.
public void gamepads ( )
{
Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
int quantity = 0;
for (int i = 0; i < controllers.length; i++)
{
if ( ( controllers[i].getType()==Controller.Type.STICK ) ) quantity++;
if ( ( controllers[i].getType()==Controller.Type.GAMEPAD ) ) quantity++;
controllers[i].poll();
net.java.games.input.EventQueue queue = controllers[i].getEventQueue();
Event event = new Event();
if ( ( controllers[i].getType()==Controller.Type.STICK ) || ( controllers[i].getType()==Controller.Type.GAMEPAD ) )
while (queue.getNextEvent(event))
{
net.java.games.input.Component comp = event.getComponent();
if ( ( quantity == 1 ) && ( comp.getName()=="x" ) ) {leri = -event.getValue();}
if ( ( quantity == 1 ) && ( comp.getName()=="rz") ) {leri2 = -event.getValue();}
if ( ( quantity == 2 ) && ( comp.getName()=="x" ) ) {leri3= -event.getValue();}
if ( ( quantity == 2 ) && ( comp.getName()=="rz") ) {leri4 = -event.getValue();}
System.out.println( comp.getName());
System.out.println( event.getValue());
}
}
}
( edit. )
Do you know a link to an tutorial or source, witch i could use studying LWJGL and its component JINPUT a bit more ??
Tutorial/Source could be build to read all the values all the time and without an happen event ??
//----
Thanks,