LWJGL
October 20, 2014, 22:16:19 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.1 released!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: How to disable/hide mouse pointer  (Read 15713 times)
chriddel
Newbie
*
Posts: 27


WWW
« on: June 08, 2004, 17:00:04 »

I am almost afraid to ask... but is there a way to disable or hide the mouse pointer in java/lwjgl? its always flickering so i would prefer it to disappear. or maybe its just very easy to make it stop flickering??

 :oops:
sorry if thats a very stupid question, but i searched google for solution but didnt find anything but c++ code.

thanks,

chris
Logged
Matzon
Administrator
Demigod
*****
Posts: 2242



« Reply #1 on: June 08, 2004, 22:18:08 »

Quote
setGrabbed

public static void setGrabbed(boolean grab)

    Sets whether or not the mouse has grabbed the cursor (and thus hidden).
on Mouse.

The flickering however, is odd - whats your OS and drivers?
Logged

chriddel
Newbie
*
Posts: 27


WWW
« Reply #2 on: June 09, 2004, 02:14:25 »

thank you matzon,

i use win xp and s3 twister - it might be the driver because i just owe a notebook with a "normal" graphic-card  :cry:  it also happens to the nehe tutorial examples in c++. but its strange because alienflux shows the mouse pointer without flickering.

btw: i cant find the public static void setGrabbed(boolean grab) in the 0.8 distribution. is it new in 0.9?

thanks + bye,

chris
Logged
Matzon
Administrator
Demigod
*****
Posts: 2242



« Reply #3 on: June 09, 2004, 02:50:10 »

Quote from: "chriddel"
i use win xp and s3 twister - it might be the driver because i just owe a notebook with a "normal" graphic-card  :cry:  it also happens to the nehe tutorial examples in c++. but its strange because alienflux shows the mouse pointer without flickering.
Hmm, might be something else than drivers then - just don't know where to start...
Quote from: "chriddel"

btw: i cant find the public static void setGrabbed(boolean grab) in the 0.8 distribution. is it new in 0.9?
Yup
Logged

Fool Running
Nerdus Imperius
*****
Posts: 828


« Reply #4 on: June 09, 2004, 06:00:51 »

If you are using 0.8 and don't want to change all of your code to 0.9, I think you can just call Mouse.create() and that will hide the mouse cursor.
(Just remember to call Mouse.destroy() afterwards.  :roll: )
Logged

Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option Grin
chriddel
Newbie
*
Posts: 27


WWW
« Reply #5 on: June 09, 2004, 07:30:13 »

Cheesy thanx! that worked great!
I just hope I won´t need the mouse pointer again  :shock:

Actually I am not stick with 0.8 but I had the feeling that its slightly faster than 0.9 (just a feeling - I didnt do any benchmarks)

chris
Logged
oNyx
Talks Too Much
***
Posts: 177


弾幕


« Reply #6 on: June 18, 2004, 09:17:25 »

>I just hope I won´t need the mouse pointer again

Hehe Smiley

Well, it sounds like a driver issue with hardware cursors. Btw AF's mouse cursor is/was done in software. So if you ever need a cursor and your driver is still broken you can just use a software cursor instead (just draw a quad with a cursor texture aligned to the mouse position - that's it).
Logged

chriddel
Newbie
*
Posts: 27


WWW
« Reply #7 on: June 22, 2004, 15:39:40 »

Cheesy Thanx for the good hint!

No more headache with my mouse!  Cool

Chris
Logged
n4pgamer
Newbie
*
Posts: 9


« Reply #8 on: December 22, 2011, 07:09:30 »

How can I hide the Cursor AND let it leave the Display window ? I'm using window mode and want to hide the cursor only when it is over the game window.
Logged
princec
Nerdus Imperius
*****
Posts: 1878



WWW
« Reply #9 on: December 22, 2011, 08:21:15 »

That behaviour sounds entirely wrong.

Cas Smiley
Logged

n4pgamer
Newbie
*
Posts: 9


« Reply #10 on: December 22, 2011, 11:10:36 »

That behaviour sounds entirely wrong.

I can't believe I'm reading this ....
It is a very common behaviour in windowed games.
Not everything is in first-person-perspective.
Logged
CodeBunny
Nerdus Imperius
*****
Posts: 562



WWW
« Reply #11 on: December 22, 2011, 17:46:55 »

I can vouch. I've seen games do this before.

It's mainly for games that are windowed, so they don't want to lock the cursor; but they don't want to have the mouse cursor in the way of gameplay. Usually it's either a game that doesn't need the cursor at all, or it has a cursor it draws on its own.

I think a hackish way of doing this would be to simply set the cursor to a transparent image.
Logged
n4pgamer
Newbie
*
Posts: 9


« Reply #12 on: December 22, 2011, 22:22:56 »

I think a hackish way of doing this would be to simply set the cursor to a transparent image.
Sorry if I'm too lazy right now. But what functions do I use to do that ? That sounds good.
Logged
princec
Nerdus Imperius
*****
Posts: 1878



WWW
« Reply #13 on: December 23, 2011, 13:05:03 »

Oh, I think I've just understood what you are trying to achieve - you want an invisible mouse, but you don't want to grab the mouse. Just set the mouse to a single invisible image:
Code:
emptyCursor = new Cursor(1, 1, 0, 0, 1, BufferUtils.createIntBuffer(1), null);
Mouse.setNativeCursor(emptyCursor);


Cas Smiley
Logged

CodeBunny
Nerdus Imperius
*****
Posts: 562



WWW
« Reply #14 on: December 24, 2011, 07:55:50 »

That's an ugly way to do it, though. The most sensible thing to do would be to have some sort of call such as: Mouse.showNativeCursor(false).

Any chance this could get added to the API at some point? It seems like an easy enough change.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!