Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Hardware Mouse Cursor questions

This thread is locked; no one can reply to it. rss feed Print
Hardware Mouse Cursor questions
bhagabhi
Member #1,660
November 2001

How many different setups of the mouse is there?

I have been playing around with my mouse code - the one I used to use made the mouse trapped inside the window even if I was in windowed mode, so that obviously needed a change.

So now - using code like this to set up the mouse:

and gfx_capabilities returns no HW_CURSOR and no SYSTEM_CURSOR, but still I got a mousepointer that is visible "outside" of the window in windowed mode when moved to the edges. Is this expected?

I mean - the full bitmap that is used as a mouse pointer is visible over the desktop when moved to the right and bottom edges even if a normal allegro bitmap would be cut and limited to the window.

I am on my Debian Etch using Allegro 4.2.1 (the version meant for testing that were uploaded on the mailinglist or if it was the forum a while ago).

Anyway - The main question is - Am I just "lucky" being on an X system, and this isn't reproducible on other platforms - I think I saw something like that mentioned concerning DirectX Fullscreen at least.

Maikol
Member #4,997
September 2004
avatar

Hi attach a screenshot; my mouse sprite doesn't go out of the window!

EDITED: Well I've just seen that pic and of course mouse doesn't appear jaja but I ensure you it doesn't go out..

El sabio no dice todo lo que piensa, pero siempre piensa todo lo que dice
Aristóteles

bhagabhi
Member #1,660
November 2001

Heh - Yeah - seems harder than one might think to get a screenshot of this... both Gnome-screenshot and Gimp seem to remove the Mouse before saving the image...

[Edit]

Self-made screenshot attached. -this is exactly what it looks like - but since there are troubles including the mouse in the screen-capture I made the effect by hand.

(the disk is the mouse pointer.)
[/Edit]

Evert
Member #794
November 2000
avatar

Quote:

gfx_capabilities returns no HW_CURSOR and no SYSTEM_CURSOR, but still I got a mousepointer that is visible "outside" of the window in windowed mode when moved to the edges. Is this expected?

When are you testing gfx_capabilities? The HW_CURSOR and SYSTEM_CURSOR flags are only set after you call show_mouse(). Anyway, if the cursor shows over the edge of the screen (as opposed to being clipped against the window edge), it is a hardware cursor.
Also check what the test program says about having or not having a hardware cursor.

Quote:

Anyway - The main question is - Am I just "lucky" being on an X system, and this isn't reproducible on other platforms - I think I saw something like that mentioned concerning DirectX Fullscreen at least.

X11 always supports hardware cursors in both windowed mode and fullscreen mode if the proper X11 extensions are available, but they interfere with get_mouse_mickeys(), which wants to trap the physical cursor in the centre of the window to get an infinate range of mouse movement. So they are disabled by default.
Actually, I think DirectX fullscreen is the only platform that doesn't do hardware cursors at all.

bhagabhi
Member #1,660
November 2001

Ah - Yeah, its my confusion that has gotten into play once again ;)

I thought that I should use the gfx_capabilities to make sure I could make use of a hardware cursor, when it actually represents if you are using it or not (by previously setting it using enable_hardware_cursor).

Anyway - Thanks Evert!

Evert
Member #794
November 2000
avatar

Quote:

I thought that I should use the gfx_capabilities to make sure I could make use of a hardware cursor, when it actually represents if you are using it or not

That's what one would normally expect, but unfortunately it can't reliably work that way: in Windows, for instance, you can only use hardware cursors under certain conditions (there are size restrictions) and you don't know if you can get a hardware cursor until you try.

Quote:

Anyway - Thanks Evert!

You're welcome.

Go to: