Archived

This topic is now archived and is closed to further replies.

Moe

hiding the cursor? how?

Recommended Posts

I had an idea. I would take the position of the mouse (with the cursor off) and blit a bitmap. Since I am using page flipping, I wouldn''t need to redraw anything. Now here is the problem. How can I turn the mouse cursor off? (isn''t there some thing like echo off or something?) Shrapnel Games

Share this post


Link to post
Share on other sites
Actually it's ShowCursor(0); to turn it off and ShowCursor(1); to turn it back on when your program exits...

Set cursor changes the cursor to anotherone using a handle returned by CreateCursor or LoadCursor or LoadImage...

So at the beggining of your program

ShowCursor(0);

and athe end

ShowCursor(1);

Happy coding!
- Ben

Edited by - cyberben on July 19, 2000 1:22:07 AM

Share this post


Link to post
Share on other sites
Not sure that this is the right forum for this question, but the topic is right.
Anyhow, thats how you turn the cursor on and off using Win32, does anyone know how to do the same thing using XWindows?

Thanks.

Share this post


Link to post
Share on other sites
And not only can others benefit from answered questions, but somebody might post a revolutionary additional tip, like this one:

To avoid the hassle of keeping track of ShowCursor(0) & ShowCursor(1) pairs, you can also create an empty cursor and use SetCursor(HCURSOR empty_cursor) to hide it without knowing what''s going to happen afterwards...

Greetings,

CondorWitte.

Share this post


Link to post
Share on other sites
I''ve forgotten to turn the cursor on before exiting from my programs. What potential problems can this cause? I''m assuming that my windowed app has separate attributes then the rest of windows. The showcursor(0) doesn''t effect the other programs does it after my program exits?

IceFire
(the old fart)

Share this post


Link to post
Share on other sites
I don't have to worry too much about forgetting to show the cursor when my program is finnished since it is divided into the usual game_main();, game_init();, and game_shutdown(); functions.

I ran into another kind of a problem. Check it out under the post called : using a bitmap as a custom cursor.
Shrapnel Games

Edited by - Moe on July 19, 2000 12:08:29 AM

Share this post


Link to post
Share on other sites