Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (105)
games submitted by our members
Games in WIP (524)
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: Quake-like Mouse Control on: 2006-02-09 10:52:05
Thanks - in the end I chose to port my app. to lwjgl - which means the raft of refactorings I've had in the back of my mind for a while can be implemented Smiley - you're right though - it does feel weird to have the mouse 'grabbed' in a window, but isn't to bad once you geet used to it - 'apple-tab' app switching is ok enough.  Thanks for the input - cheers,

Colin
2  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-05 06:15:24
Hi Jeff - that works except that even with the cursor hidden it still tracks - and when it goes past the edge of the screen - i.e. my window loses focus - the cursor reappears - I can't move the mouse infinitely in any direction - only within the bounds of my game window.  Basically just because my window hides the cursor, doesn't mean the OS X windowing system stops tracking it - I need to be able to move the mouse any distance in any direction without the OS X windowing system cursor moving.  Cheers,

Colin
3  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-05 00:41:21
Thanks for the responses...

I get the difference beetween the mouse and the cursor - but it sounds like I might have things a bit confused in other ways.  Perhaps I need to roll back and ask some more fundamental questions.  Perhaps JInput isn't what I'm after.

Can I stop the OS  (OS X in this case) Windowing System cursor moving while my game window has focus?  It seems the answer is yes, because both lwjgl and jake2 achieve this.  Did they write their own custom native implementation to achieve this - or is there a method somewhere that I'm missing.   

Essentially this would have to happen in one of three ways -

1.  The Windowing System stops polling the mouse driver (if thats how it gets mouse movement data - JInput model)
2.  The Windowing System would have to stop listening for mouse movement events (if thats how it works - the AWT model)
3.   The mouse driver the Windowing System is using would have to present information (polling or eventing) that indicated no mouse movement.  If the model is eventing, then this would prrobably mean never raising the event.

The ugly other option here would be to continually move the cursor back to the centre of the screen with something like the java.awt.Robot class.

I can hide the system mouse cursor and draw my own in JOGL, but I suspect that if any of the above 3 things happened, then AWT would not receive mouse events either.  Hence I would need something like JInput to receive mouse movement data.

So the question is - for Quake-like mouse control - how do I stop the Windowing System cursor from moving when my window has focus?

At the moment I think I'm going to have to go with JInput and java.awt.Robot - but that seems dodgy - hopefully the Robot won't interact wiith JInput - seems ok at first glance.  Cheers,

Colin

4  Java Game APIs & Engines / JInput / Quake-like Mouse Control on: 2006-02-04 01:46:28
I read a post by endolf here http://72.14.207.104/search?q=cache:_JTiqa9OGnUJ:www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi%3Fboard%3Djinput%3Baction%3Ddisplay%3Bnum%3D1083727410+jinput+quake&hl=en&ct=clnk&cd=2&client=safari (sorry for the cached google - but the forums seen to have been down for ages now) that suggested achieving quake like mouse look behaviour in java would be ideally suited to jinput.

Ok - great cos thats what I want Smiley.  Trouble is I'm struggling to work out how this is achieved - in fact I'm considering moving from jogl to lwjgl purely because of the mouse control (which is crazy - considering their mouse input is apparently based on jinput, which should work fine with jogl).  I've trawled the lwjgl source to try and work it out - but its not coming to me - I feel like I'm missing a part of JInput.

The functionality I can't seem to get is what lwjgl achieves with 'Mouse.setGrabbed(true)' - the mouse control is 'grabbed' from the underlying OS and the mouse doesn't scroll out of the window.  Easy to see what I'm talking about if you run the lwjgl MouseTest annd try modifying the setGrabbed to false.  Maybe its achieved by moving the mouse back to the centre of the screen all the time.  Dunno but I figure its more likely that the hardware events are not being passed to the OS.

So how do you do this with JInput?  The polling bit I get, so I can control my scene with the mouse - as long as I don't want to turn more than 270 degrees and lose the mouse off the edge of the window.  If anyone could give me any idea on this that would be a great - if I've missed pile of docs or how-to's or a wiki or something, a pointer to that would be much appreciated as well - thanks,

Colin

P.S. Once I've got it sorted out I'd be happy to post the walkthrough on a wiki somewhere if there is one...
5  Java Game APIs & Engines / JInput / Re: Mac OSX: turn debug off? on: 2006-02-04 01:18:55
I did see somewhere that it could be turned off by setting a switch and rebuilding the source - you're right - it's a killer - doesn't crash eclipse, but makes the existence of my own log messages pretty pointless.  Is there a reason the debug can't be controlled from a setter rather than requiring a recompile?  Maybe thats a stupid question Smiley - Interestingly if you run the MouseTest from lwjgl you dont get the console output - but if you copy the libs (either/both jinput.jar, libjinput.jnilib) from lwjgl distribution and use those, the console output still apears.  Seems to imply the lwjgl guys have worked out how to suppress the output without rebuilding the libs.   Maybe lwjgl isn't using jinput for mouse, but I thought I had read that they were.  Anyway - just general agreement here that a way to suppress the debug without doing a recompile would be good.
6  Java Game APIs & Engines / JOGL Development / Re: Trouble with neHe tutorial 14 on os X? on: 2004-09-12 08:50:24
A quick note - if I comment out the line 'frame.pack()' then tutorial 14 runs correctly - albeit in a tiny window, but I can see the animated text in there.  Put that line back and it crashes....  also it doesn't seem to be an eclipse problem, as an exported runnable jar exhibits the same behaviour outside this environment.
7  Java Game APIs & Engines / JOGL Development / Trouble with neHe tutorial 14 on os X? on: 2004-09-11 21:04:05
Hi,

  I looking at some of the NeHe tutorials on os X - at the moment 13 and 14.  I imported tutorial 14 into eclipse 3.0 and ran it successfully - once.  From now on, reboot or otherwise I get the following exception -

Error: view not ready, cannot lock focus at "src/native/jogl/MacOSXWindowSystemInterface.m:createContext:72"
net.java.games.jogl.GLException: Error creating nsContext
     at net.java.games.jogl.impl.macosx.MacOSXGLContext.create(MacOSXGLContext.java:127)
     at net.java.games.jogl.impl.macosx.MacOSXGLContext.makeCurrent(MacOSXGLContext.java:136)
     at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.makeCurrent(MacOSXOnscreenGLContext.java:131)
     at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:203)
     at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.invokeGL(MacOSXOnscreenGLContext.java:79)
     at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:194)
     at net.java.games.jogl.GLCanvas.display(GLCanvas.java:82)
     at lesson14.GLDisplay$AnimatorTimerTask.run(GLDisplay.java:112)
     at java.util.TimerThread.mainLoop(Timer.java:432)
     at java.util.TimerThread.run(Timer.java:382)

I can still run all my own code and tutorial 13 successfully.  The one thing I found looking at this forum is that there seems to be a problem in OS X with full screen mode?  This is relevant because after running tutorial 14 successfully for the first time, I ran tutorial 13 in full screen mode, and saw only static text.  Running 13 without full screen mode displays animated text.  I am thinking perhaps that the full screen run of 13 has left something in a dodgy state?  Tutorial 13 now runs both modes with animated text, so not sure what the original static text problem was, but it does seem very possibly related.  Still pretty much a beginner at JOGL so I could be missing something obvious.  

Has anyone else seen this error or successfully run the tutorial sequence above?  Any pointers appreciated, thanks.
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

SHC (24 views)
2014-07-12 17:50:04

Riven (30 views)
2014-07-10 20:20:18

CopyableCougar4 (29 views)
2014-07-10 02:26:14

CopyableCougar4 (32 views)
2014-07-09 02:55:38

Code Mage (33 views)
2014-07-08 23:57:00

Code Mage (20 views)
2014-07-08 23:49:08

AppleSauce (28 views)
2014-07-08 19:25:32

CopyableCougar4 (28 views)
2014-07-06 01:51:26

ipe369 (35 views)
2014-07-05 14:18:25

vastrolorde (44 views)
2014-07-04 18:45:44
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!