LWJGL Input

Started by kevglass, June 01, 2005, 09:44:10

Previous topic - Next topic

oNyx

<kevglass> woot
<kevglass> jinput binaries
<Mazon> :)
<aho> :o
<kevglass> spose I'll have to find time to sort it out now :)
[...]
<aho> thought about throwing some getSimpleX/Y() methods which also throw in pov stuff (makes it rather reliable... so i've heard) :>
<kevglass> post it on the forum
<kevglass> let someone decide
<kevglass> I'll just do whatever the concensus wants

Opinions please :)

irrisor

Hi, nice work with the joystick support! :D

Though I have some issue:
When I enable polling of events for the joystick controllers my keyboard and mouse stop responding in the application. I have a combined mouse and keyboard device which has category 'device' (neither keybord nor mouse; on Windows) - any ideas what to do?
(One could search for "Mouse" or "Keyboard" in the name, but I would consider that pretty dirty...)

Second thing: I don't like the constantly created event-objects :? (after a while the gc has to collect them and causes lag, no?)  Any chance to get rid of them? E.g. doing method calls with current event fields as parameters?

Btw. any plans for rumble support?  :)

oNyx

Try calling Controllers.create() prior to Display.create().

I'm not really sure if thats still necessary with the current version (included in lwjgl 0.98 )... however, it does work there, too.

And those few objects. They are tiny and short-living. They aren't a problem at all (even on the slowest machine here... its a k6-2 300mhz/128mb/voodoo banshee 16mb).

Recreating buffers is slow (re-use em) or creating several thousand objects per frame, but a handfull tiny wrapper thingies dont change a thing ;)

(Always use a profiler prior to optimisation)

irrisor

It helps, thanks!

Regarding the event objects: whatever you say  :wink:
- can that really be measured by a profiler? Which one?

oNyx

I didnt really took a closer look. I just know that there wasnt a measurable difference between the version without input stuff and the one with input stuff. Therefore I didnt bother to do any real comparision ;)

Either way its like 0-5 tiny objects per frame. You can create way more objects before it gets troublesome.

And profilers... well, you can try the -Xprof and -Xloggc:<file> flags. You can also try the rather new netbeans profiler or one of those eclipse profiler plugins.

Orangy Tang

When using a Controller, how do I know which of the GetXAxisValue/GetYAxisValue/etc. methods represent something on the controller, and which are inert because the controller doesn't support them? Do I have to use getAxisName to find out which are present?