Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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]
EgonOlsen (42 views)
2018-06-10 19:43:48

EgonOlsen (22 views)
2018-06-10 19:43:44

EgonOlsen (43 views)
2018-06-10 19:43:20

DesertCoockie (197 views)
2018-05-13 18:23:11

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

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

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

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

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

Solater (140 views)
2018-03-17 05:04:08
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!