![]() |
|
Hardware cursor enable / disable. |
Richard Phipps
Member #1,632
November 2001
![]() |
Ok, If I run my game in a windowed mode and I want to display the hardware cursor I can do: And it appears and works fine. However, when I want to hide the mouse cursor so I can return to the game I can't seem to get rid of the OS cursor! I'm currently trying: select_mouse_cursor(MOUSE_CURSOR_NONE); show_mouse(screen); scare_mouse(); disable_hardware_cursor(); And I'm tried various combinations but the hardware cursor is still there. Does anyone have any idea? Allegro 4.2.0, Windows XP, using AllegroGL 0.4.0 and OpenLayer 2.0 Thanks! |
Peter Hull
Member #1,136
March 2001
|
|
Elias
Member #358
May 2000
|
Try: show_mouse(NULL); Also, in case you do not want to fall back to the software cursor when no HW cursor is available, it's simpler to use show_os_cursor() instead of enable_hardware_cursor()/show_mouse(). -- |
Peter Hull
Member #1,136
March 2001
|
Elias: If that works, then I'm taking the credit Pete
|
Richard Phipps
Member #1,632
November 2001
![]() |
Nope, I already tried show_mouse(NULL). I don't know whether because I am using AllegroGL this is relevant? Any more ideas? |
Peter Hull
Member #1,136
March 2001
|
Quote: Nope, I already tried show_mouse(NULL).
Elias, that was terrible advice, you idiot. Pete ps. That mouse code is platform dependent, so we really need a Windows person to determine what the problem is.
|
Richard Phipps
Member #1,632
November 2001
![]() |
This is the disable_hardware_cursor section (mouse.c):
However, the enable_hardware_cursor in the windows driver is empty (wmouse.c): /* mouse_directx_enable_hardware_cursor: * enable the hardware cursor; actually a no-op in Windows, but we need to * put something in the vtable. */ static void mouse_directx_enable_hardware_cursor(int mode) { /* Do nothing */ (void)mode; } So it seems only allow_system_cursor = FALSE; is really being changed and this is used in show_mouse():
Ok. Show mouse calls: |
Runesabre
Member #7,573
August 2006
![]() |
My problem is I can't make the hardware cursor disappear on the Mac in fullscreen. It seems the Mac Allegro fullscreen driver shows the hardware cursor regardless of what you try to tell it. _______________ |
Elias
Member #358
May 2000
|
Quote:
If that works, then I'm taking the credit Elias, that was terrible advice, you idiot.
Yes, yes, now I see how you thought that out My guess is, the AllegroGL GFX_DRIVER needs the methods show_mouse and hide_mouse filled in. And we also need to find out why the current implementation doesn't work at all with fullscreen mode in Windows - I'm sure I have seen games use the mouse in fullscreen mode, so there should be a way to do it. -- |
Richard Phipps
Member #1,632
November 2001
![]() |
I've had to use a software cursor in the end, which is not ideal and of course looks different from the OS cursor. I don't have time to try to add the changes myself or wait for them to be done. But these kind of things do really need doing.. |
Evert
Member #794
November 2000
![]() |
Quote: However, the enable_hardware_cursor in the windows driver is empty (wmouse.c): Right; that's because Windows doesn't need anything special to enable the hardware cursor (or rather, the hardware cursor in Windows doesn't interfere with get_mouse_mickeys() as it does in X11, where get_mouse_mickeys() causes the hardware cursor to be trapped in the window). Quote: And we also need to find out why the current implementation doesn't work at all with fullscreen mode in Windows
Because Windows cannot display a mouse cursor in a full-screen DirectX application. At least the normal Windows way for setting the mouse cursor doesn't do anything in that case. This is documented, so it probably doesn't count as a bug. |
Richard Phipps
Member #1,632
November 2001
![]() |
I did try using the MSN commands ShowCursor(FALSE), ChangeCursor, but none of them seemed to have any effect. I suspect Allegro is rechanging the values. |
Elias
Member #358
May 2000
|
Quote:
Because Windows cannot display a mouse cursor in a full-screen DirectX application. At least the normal Windows way for setting the mouse cursor doesn't do anything in that case. This is documented, so it probably doesn't count as a bug. Hm, I think I remember, I got the mouse cursor displayed in some fullscreen app when I did in fact not even want it. But well, probably makes sense in some way, the HW cursor probably interferes with the full control you get over the GFX card with DX. And maybe it changes in Vista. -- |
Milan Mimica
Member #3,877
September 2003
![]() |
That's strange because bugs.txt from AllegroGL says:
I guess bugs.txt can be declared deprecated
-- |
Evert
Member #794
November 2000
![]() |
Quote: I did try using the MSN commands ShowCursor(FALSE), ChangeCursor, but none of them seemed to have any effect. I suspect Allegro is rechanging the values. No, reread what I said: it doesn't work. I tried the exact same thing when I implemented the hardware cursor for Windows a year (two years?) ago. |
Richard Phipps
Member #1,632
November 2001
![]() |
I must have missed your edit then.. |
Evert
Member #794
November 2000
![]() |
You were quick then, since I added my edit almost immediately. I actually thought it was a redundant addition... apparently not though (Redundant because we of course all do our homework before saying that X cannot do Y, right?) EDIT: On fullscreen OpenGL, that may very well be a different issue (I have really no idea). My understanding is that Windows cannot display a cursor on a fullscreen DirectX surface. |
Richard Phipps
Member #1,632
November 2001
![]() |
So aside from the fullscreen cursor issue, we have no idea why we cannot remove the hardware cursor from the screen in windowed mode after being turned on? |
|