Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (755)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JInput / Re: Mouse support - OSX on: 2006-03-10 06:48:04
I just want to thank you for putting so much work into this library, Elias.  I know we all keep asking, "are we there yet, are we there yet?"  We must be driving you nuts.
2  Java Game APIs & Engines / JInput / Re: Mouse support - OSX on: 2006-02-28 04:42:45
When polling the system mouse seems to rember the last polls casuing the mouse poll to report movement even though I'm not moving the mouse.

I've been having this problem, too, on Panther.  But not always.  Can anyone tell me why the attached class does not suffer from this bug?
3  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-26 20:43:28
This works perfectly for me (with jogl)

Hiding the cursor is easy.  What we want is to immobilize the cursor.
4  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-20 03:39:06
Sweet!  It works!  My cursor freeze doesn't block JInput!
5  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-20 02:33:35
I think this cursor locking function is something that only game developers really need.  So it doesn't belong in a graphics API or an input API.  It belongs in a game API.  Problem is, there's no catch-all framework like SDL on the Java platform -- yet -- except for LWJGL.

So... maybe the thing to do is write another library that makes use of JInput, but can lock and unlock the cursor -- or use java.awt.Robot.mouseMove() on platforms where this is unavailable.  Then I wrap JInput's mouse functionality in my own Mouse class, and use everything else in JInput as is.  Since the Mac is the main platform on which the Robot approach causes problems, this would be a portable and environmentally friendly approach.

No need to pollute.
6  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-19 23:46:49
You can use JOGL's OpenGL bindings with LWJGL (and vice versa). To use JOGL with LWJGL's OpenGL context, call GLDrawableFactory.createExternalGLContext() when LWJGL's OpenGL context is current, and call GLContext.getGL() on the resulting GLContext object when you want to draw. LWJGL has similar functionality.

Thank you.  I'll try that.

Here's another question: for the time being, if I used my own native library to surpress cursor movement, would JInput still report mouse motion?
7  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-19 19:12:16
I'd much rather let someone else handle the headache of writing JNI code.

Here's the thing: this mouse input issue is the one thing that might discourage me from using Java for my game.

So JInput is wonderful.  It does everything I need as far as user input goes except that it doesn't allow you to unplug the cursor from the mouse.

I've tried LWJGL for this, and it works great, but I dislike their OpenGL bindings.  It is particularly obnoxious that gluUnProject wants double-scripted projection arrays (where OpenGL uses single-scripted arrays as a rule) whereas glGetDouble gives you a DoubleBuffer.  So if I went with LWJGL, I'd need a way to use JOGL in place of LWJGL's own GL.

I've had good experiences with Simple DirectMedia Layer in C, and I know that there is a project to bind SDL to Java (  Unfortunatley, sdljava is incomplete and still missing most of OpenGL.

And I'm not satisfied with my little native library.

So what's a poor Java programmer like me supposed to do?
8  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-18 02:17:32
I know that the mouse reading functionality is available in JInput.  It's just that learning how to use somebody else's JARs always takes time and I sometimes get lazy.  That's why I wrote JNI calls.  Besides, JInput is using JNI itself.

Jake2 runs at an acceptable rate on my machine, except if you try to use the mouse.
9  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-13 01:46:34
I tried using java.awt.Robot to warp the cursor.  It worked, but very slowly: it could take upwards of a hundred milliseconds to read the mouse position once on Mac OS X.  Windows performed significantly better, but was still sluggish.  I also tried outsourcing the cursor warping to a native C method, but that increased the lag to more than one second for some reason.

I finally wound up using the approach mentioned in this forum of freezing the cursor and reading the mouse deltas.

For freezing the cursor, use the following Carbon function (if you're on Mac OS X):

Reading the mouse deltas is a little bit more obnoxious, just because JNI can be very tempermental.

CGMouseDelta x, y;

Then x and y represent the amount by which the mouse position changed the last time the application received a mouse event.  By application, I mean the parent process that contains the JVM.  Whenever you launch a Java application on Mac OS X it seems like the JVM gets wrapped up inside a Cocoa application.  So I cannot guarantee that my techniques would work in an applet.

Now, of course my native library only works on OS X.  But I think that this behavior would not be too hard to port to other platforms.  It's obviously been done before.

If you still have any interest in using JOGL, I would be happy to post my Java and C source files, as well as my shared libraries and JARs.
Pages: [1]
DesertCoockie (36 views)
2018-05-13 18:23:11

nelsongames (81 views)
2018-04-24 18:15:36

nelsongames (73 views)
2018-04-24 18:14:32

ivj94 (755 views)
2018-03-24 14:47:39

ivj94 (85 views)
2018-03-24 14:46:31

ivj94 (626 views)
2018-03-24 14:43:53

Solater (101 views)
2018-03-17 05:04:08

nelsongames (182 views)
2018-03-05 17:56:34

Gornova (408 views)
2018-03-02 22:15:33

buddyBro (1068 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!