Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (724)
Games in Android Showcase (216)
games submitted by our members
Games in WIP (791)
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 09: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,

2  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-05 05: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,

3  Java Game APIs & Engines / JInput / Re: Quake-like Mouse Control on: 2006-02-04 23: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,


4  Java Game APIs & Engines / JInput / Quake-like Mouse Control on: 2006-02-04 00:46:28
I read a post by endolf here (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,


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 00: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 06: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 19:04:05

  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" Error creating nsContext
     at lesson14.GLDisplay$
     at java.util.TimerThread.mainLoop(

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]
Archive (41 views)
2017-04-27 17:45:51

buddyBro (252 views)
2017-04-05 03:38:00

CopyableCougar4 (674 views)
2017-03-24 15:39:42

theagentd (675 views)
2017-03-24 15:32:08

Rule (721 views)
2017-03-19 12:43:22

Rule (696 views)
2017-03-19 12:42:17

Rule (697 views)
2017-03-19 12:36:21

theagentd (711 views)
2017-03-16 05:07:07

theagentd (643 views)
2017-03-15 22:37:06

theagentd (484 views)
2017-03-15 22:32:18
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

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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!