Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (206)
games submitted by our members
Games in WIP (781)
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]
Galdo (230 views)
2017-01-12 13:44:09

Archive (399 views)
2017-01-02 05:31:41

0AndrewShepherd0 (858 views)
2016-12-16 03:58:39

0AndrewShepherd0 (795 views)
2016-12-15 21:50:57

Lunch (932 views)
2016-12-06 16:01:40

ral0r2 (1160 views)
2016-11-23 16:08:26

ClaasJG (1264 views)
2016-11-10 17:36:32

CoffeeChemist (1303 views)
2016-11-05 00:46:53

jay4842 (1387 views)
2016-11-01 19:04:52

theagentd (1207 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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!