cursor remains in openGL fullscreen

This is a discussion on cursor remains in openGL fullscreen within the Game Programming forums, part of the General Programming Boards category; I have an openGL c++ windows class wrapper capable of switching display from fullscreen to windowed and back again based ...

  1. #1
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227

    cursor remains in openGL fullscreen

    I have an openGL c++ windows class wrapper capable of switching display from fullscreen to windowed and back again based on user choice based on graphics capability. I have an intermittent glitch where the cursor hangs around in fullscreen display.

    Things tried:

    1. No wnd class cursor.
    2. Used ShowCursor and tested return value to ensure ok
    3. WM_SETCURSOR to explicitly set and kill cursor.

    The odd thing is that it appears to work when you run the app once, but then the damned cursor appears (even when there isn't a wnd class cursor) in fullscreen display. Double-clicking on the window causes the cursor to disappear and re-enables keyboard input (tried SetForeGroundWindow, SetFocus - didn't help). The other odd thing i've noticed is that if I delay the application start with eg Sleep then the cursor disappears as it should; but then when I dynamically change the display mode the cursor re-appears at the new (fullscreen) settings!

    Any and all suggestions would be very welcome. Thanks in advance.

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    im not sure why your having this problem, do you call ShowCursor() right after the switch or what?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    In tests where I use ShowCursor, I use it to remove the cursor immediately after the call to ChangeDisplaySettings; i've also tried it out in different places without much difference in result. I also use it to re-establish the cursor when I return to default desktop/registry settings.

    The thing I find bizarre about this is when I don't even have a wnd class cursor, don't use ShowCursor and still get the default 'arrow' cursor appearing in fullscreen display.

  4. #4
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    If you want to attach your code, maybe we'd be able to find your problem.
    How are not having a wnd class cursor? If you're just using NULL it'll load the default cursor for you.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

  5. #5
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>How are not having a wnd class cursor? If you're just using NULL it'll load the default cursor for you.<<

    from msdn description for the hCursor param of WNDCLASSEX:

    "If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window."

    ie NULL== no cursor, to explicitly set it you would have to handle the WM_SETCURSOR. This is what i'm finding as wierd, that when I have no class cursor, don't use ShowCursor and don't handle WM_SETCURSOR, the default arrow cursor still intermittently appears in the fullscreen display. I don't get a cursor appearing in windowed mode, as expected.

  6. #6
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    Sorry, but whenever I used NULL it uses the default system cursor. Oh well. Still if you want to post the code, I'll be glad to take a look at it.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 01:39 PM
  2. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 09:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21