Controllers

Started by kevglass, August 29, 2004, 17:14:01

Previous topic - Next topic

kevglass

Is there anyone working on "Controller" implementations for other platforms, i.e. Linux?

On another note, has anyone considered extending the LWJGL controller support to allow multiple controllers on one machine?

Kev

elias

Not that I know of. I (the linux maintainer) don't even have a gamepad or joystick of any sort. Multiple controllers would be nice though, it's probably a pretty common setup (esp. if you're a wannabe console maker, right? ;-) )

- elias

PlanetMongo

Quote from: "elias"Not that I know of. I (the linux maintainer) don't even have a gamepad or joystick of any sort. Multiple controllers would be nice though, it's probably a pretty common setup (esp. if you're a wannabe console maker, right? ;-) )

- elias

Are there harsh penalties (duties and what not) for importing USB gamepads to Denmark and what not?  If not, I might be willing to ship you a couple Gravis pads (if I can locate some) for the Linux/OS X cause, if you're interested.

EDIT:  actually, It'd probably be better to ship a couple Playstation2->USB converters.  I like the PS2 controllers over anything I've messed with on the PC front...
ife sucks, kill yourself.

Matzon

I think that elias won't have time for doing controllers for linux / mac before the actual mac port is done (ogl/oal first). And when that time arrives, hopefully somone else has done it ;) - and if not, I could probably just drive over to elias and let him borrow my controller (we live ~ <10 km from each other)

kevglass

I wouldn't mind taking a look, I'll probably want it soon anyway. But I'd like to do the multiple controllers bit at the same time (since if anything I reakon thats more important).

Essentially, since JInput already does linux alright and SDL exists it should make it pretty easy. Not to mention Endolf being a mate of mine :)

Kev

Matzon

well, I am all for doing multiple controllers, but it needs to be in a very simple api - jinput is too... fiddly for my liking.
isn't linux controllers possible without sdl? I would hate that dependency...

elias

I know that at least recent kernels (>=2.4) supports HID like the Mac OS X. That would be a good standard to expose, avoiding SDL.

- elias

kevglass

Ah, I didn't mean USE SDL, I meant read their code, work out how they did it and rewrite. SDL is LGPL anyway, too scary to get dependant on.

API:

Controllers static, getControllerCount() and getController() returning an interface that looks just like the Controller now?

Kev

Matzon

either that, or public static array of controllers?
Controller.controllers[1].getX();

or set active controller before using methods
Controller.setActiveController(index) (or Controller.use(index))

we could also pass the controller index to a method?
Controller.getX(0);


lots of ways... - though somewhat untraditional, I kinda like the last way... opinions?

elias

Definitely the Kevglass way. We certainly don't want to pass an index around to all methods.

- elias

cfmdobbie

I agree.  No point in passing around indices when you can just hold onto an Object.
ellomynameis Charlie Dobbie.

kevglass

Looking at the C for the controllers stuff it'd need heavy work to support multiple controllers (WIN32). Does this need doing?

Kev

elias

While we're at it, Controller seems slightly limited. Isn't a controller merely a collection of axes (digital or analog), buttons and whatnot? Or does every controller fit the POV, Rot axis and axis and buttons view?

- elias

kevglass

Careful, you'll turn it into JInput complexity... shouldn't the API be as game oriented as possible, the functionality it currently exposes should cover every game type in existence (and does so in a simple manner)

Kev

elias

Maybe so, but I'm still worried. What is done if the controller in question has more than one of the same type of axis for example? Will we choose one? Make them all act the same?

- elias