Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  newbie question  (Read 2642 times)
0 Members and 1 Guest are viewing this topic.
Offline altair

Senior Newbie





« Posted 2003-12-04 03:46:41 »

I have been trying to test JInput lately. I downloaded the latest lib/bin, compiled and ran the tests programs.
On my config (WinXP, athlon, no joystick) I was expecting to see a mouse and keyboard in the list of controllers but I get nothing. I wrote some code also to list the controllers and I get nothing.
So I tried the webstart based test at newdawnsoftware and I see my controllers.
I guess I must be trying to do something stupid. Also I am confused about why there are several libs with the same name in both coreAPI and plugins (which ones should be used ?). What is the difference between these libraries.
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #1 - Posted 2003-12-04 04:18:08 »

It sounds like the controller plugin for windows is not in the correct spot.  It's been a while.. but I think you typically need to put it in a 'controllers' folder.  I'm sure it is in the readme somewhere.

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2003-12-04 05:50:15 »

I think its "controller" without the "s", but yep. Or you can use the funky new property to override the whole thing which I assume documentation has been added for?

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #3 - Posted 2003-12-04 05:52:20 »

Hi
 The builds do seem a little funny. What you need as jutils.jar and jinput.jar on your classpath, the directory called controllers with (for directx) dxinput.dll and dxinput.jar in it, the dir above controllers on your classpath

ie.

cwd contains
1  
2  
3  
4  
jinput.jar
jutils.jar
controller\dxinput.dll
controller\dxinput.jar

and you should be able to just run it with
1  
java -cp .;jutils.jar;jinput.jar net.java.games.input.test.ControllerReadTest


HTH

Endolf

Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #4 - Posted 2003-12-04 05:54:17 »

Quote
Or you can use the funky new property to override the whole thing which I assume documentation has been added for?


Documenwho? Smiley

-Djinput.plugins=<pathtodxinput.jar>

i'm guessing (i've not tried it) that with this approach you will need to set up your java.library.path yourself to include wherever the native dll/so is

Cheers

Endolf

Offline altair

Senior Newbie





« Reply #5 - Posted 2003-12-04 19:30:09 »

Thanks, but no luck so far. I will do more tests later.
To say the least the packaging is 'creative': when I install JInput from the zip file, I get
jinput.jat both under coreAPI/bin and plugin/DX8/lib
jutils.jar both under coreAPI/lib and plugin/DX8/lib
dxinput.dll is both under coreAPI/src/tests/controller and plugin/DX8/bin
dxinput.jar is both under coreAPI/src/tests/controller and plugin/DX8/bin
So far, I did not know I needed to include the controller dir under tests or create a controller directory.
I created a jinput dir in my working dir and put jutils.jar and jinput.jar in there. Then I created a controller dir under jinput and copied dxinput.jar and dxinput.dll in there.
Then I tried to run my test (if it basically a wrapper around ControllerReadTest)
java -cp .;./jinput;./jinput/jinput.jar;./jinput/jutils.jar;./test/classes;./classes test.testJInput
Same result: no error but only 1 empty window because no controller is detected.
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #6 - Posted 2003-12-04 19:35:48 »

You need to move your controller directory up one so its level with where you're running from.

The packaging and layout is bizarre but I'd always just assumed there was a good reason Smiley

Kev

Offline altair

Senior Newbie





« Reply #7 - Posted 2003-12-05 00:42:52 »

You nailed it guys !

When I copy the controller directory to the level I am running from, it works (and only in this case).
I had no luck with -Djinput.plugins (any ":" in the path makes the program fail with class not found or something).

I don't know about you but I think it is a weird behavior and I do not see the rationale so far. Any user running a program using JInput needs to copy the controller dir to the installation dir ?

Thanks anyway.

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #8 - Posted 2003-12-05 02:28:07 »

The controller dir can also be placed in a more permanent spot like JRE\LIB\EXT  I think... but otherwise it is jsut a subdir of your game folder.. not that strange.

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2003-12-05 05:51:20 »

jinput.plugins isn't a list of paths, its a list of environment classes to instance at startup.

So if you put dxinput.jar in your classpath, dxinput.dll in the same location as any other native jars (or at the location you're running from) and set jinput.plugins to:

1  
net.java.games.input.DirectInputEnvironmentPlugin


Then you've explicitly told JInput to use that plugin. Its especially useful for webstart.

Kev


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #10 - Posted 2003-12-05 08:22:45 »

Yep

The original design intent was to provide 2 places to put the plugins.

(1)  In a place where all clients of a jre could use it (AIR thats jre/lib/ext/controller)

(2) In a place that could be game specific (the controller dir youa re using.)

This way JInput could be installed either as a part of the game, or as a JRE extension.  The rationale here was that a game may want to insure a version, or may have game-specific plug-ins it wants to add.

The other ways were added in order to make webstarting convenient.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Aksel

Innocent Bystander




Java games rock!


« Reply #11 - Posted 2004-08-16 21:32:20 »

Hi

Newbie myself, I think the info in this thread is valuable! (made an environment tool out of jinput with a script to add all whan I wanted to 'pollute' the classpath etc. when I wanted to use it. This didn't work as the controller dir was not located under my start dir)

thanks!

/aksel
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (11 views)
2014-04-15 03:46:01

UprightPath (24 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (108 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!