LWJGL3 GLFW_CURSOR_NORMAL hiding the mouse?

This is really confusing and it only happens when I turn of fullscreen then afterwards switch from GLFW_CURSOR_DISABLED to GLFW_CURSOR_NORMAL… After that it acts like GLFW_CURSOR_HIDDEN for some reason…

I will be willing to give any code you need but it will be alot as it is part of my game-engine… I will try to recreate the bug in a simplified form but for now, I will just describe what is happening when this bug happens…

  • I turn fullscreen off, which completely recreates the window but sharing with the old window
  • I destroy the old window
  • I then change from GLFW_CURSOR_DISABLED to GLFW_CURSOR_NORMAL

I tried googling this but got nothing… Am I doing something wrong or something?

Are you using [icode]GLFW_CURSOR_DISABLED[/icode] or [icode]GLFW_CURSOR_HIDDEN[/icode] to hide the cursor?

The first one disables the cursor, meaning that the cursor is hidden, and will be kept in the center of the window always. The second one will only hide the cursor when it is hovering over the window. If you move outside the window, it will be shown again.

I’m not sure if this is relevant, because how you are changing the fullscreen state also matters here.

I am using GLFW_CURSOR_DISABLED…

But this is why it is so weird: It ONLY (i have messed around with multiple ways) happens when I do these things in this order ish:

  • sets to fullscreen
  • hides cursor (GLFW_CURSOR_DISABLED)
  • sets to window (not fullscreen)
  • shows cursor (GLFW_CURSOR_NORMAL)

but for some reason the cursor starts to act like it is set to GLFW_CURSOR_HIDDDEN

Nevermind… just figured out the problem…
This was all happening inside a callback although they say not to call certain methods inside the callback.
Will it use anymore memory (per frame) or lag the game to have an events list which is added to in a callback and checked every frame? (now that I think of it, that is how polling systems work)

Nevermind (again)… tried using a polling system and still got the same result… Any ideas anyone?

How are you polling the input? I can’t guess anything without seeing the source code.

I was able to reproduce this. The fix is to restore GLFW_CURSOR to GLFW_CURSOR_NORMAL on the old window, before destroying it.

Thx for the help! I’ll fix that right away… ;D

Just a note: my friend was saying about some dude he met that knows how to do parkour and my friend was saying how cool it was…
My definition of cool: asking a question and the actual creator replying…

(Sry for asking so many questions, but I’m new to this GLFW [still a fun learning experience tho])

I’m not sure if I’m seeing things or not… but in fullscreen, the Gamma ramp seems to be messed up… I guess I could just set the gamma ramp at fullscreen but:

  • why is it messed up?
  • is there anyway to just simply fix it up instead of guessing the correct gamma ramp?

EDIT: just more info… it seems to start alright, but it changes to a brighter gamma ramp… Im not even sure if it is gamma but from my knowledge it does seem like it…

[quote=“matanui159,post:9,topic:52434”]
I’m not seeing anything like that with GLFW, it does not change the gamma ramp unless you explicitly call glfwSetGammaRamp. This may be a driver issue or a bug in your code.

[quote=“Spasi,post:10,topic:52434”]

… or a bug with my eyes ???
it can’t be a bug with my code because I don’t even touch anything like gamma or brightness…
maybe it is a driver problem… I might get another person to see the effect to make sure it is not my eyes…
then if it isn’t then I might see if I can get it on another computer to see if it is just my computer…