Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Sometimes I think they are TRYING to make it hard...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 SpaceRook   Members   -  Reputation: 160

Like
Likes
Like

Posted 28 January 2002 - 01:05 PM

From Tricks of the Windows Game Programming Gurus: "ShowCursor() accumulates, so if you call ShowCursor(false) 5 times, you must call ShowCursor(true) 5 times to unwind it." OK, I can envision a scenario where I *might* care how many times I call ShowCursor(false) (or true) in a row. But 99.99999% of the time, I simply juat want the system to hide the cursor, or show it. I don''t want to worry about if I called it X number of times. Why did they add this extra complexity? If people want to count how many times they make a function call, let them put their own counters in their program. It''s a big inconvenience to the rest of us. I have the cursor situation working in my program, but I am paranoid that there might be some control-flow path I didn''t take into account that will make the cursor invisible, or that will have the cursor stay visible during my game and make me look like some amateur (which of course I am).

Sponsor:

#2 poozer   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 January 2002 - 02:05 PM

Yeah. When I first saw that, I just sat there wondering "Why is ShowCursor implemented as a semaphore?" To get around it, whenever you want to hide cursor, just keep calling the ShowCursor( FALSE ) function until the display count is -1 and the cursor is hidden. Anyways, that one's more of an annoyance than a problem. You should check out DIBs (which my GDI program needs to use heavily - long story). The scanlines are layed out from bottom to top (to maintain backwards compability of course) which means you either have do alot of scanline flipping or use some very confusing tricks with negative heights (which is what I do).



Edited by - poozer on January 28, 2002 9:13:03 PM

#3 Blaster   Members   -  Reputation: 124

Like
Likes
Like

Posted 28 January 2002 - 02:30 PM

I think the reason why there is a call count in ShowCursor is very usefull.
What if you make a piece of code, or use a piece of code, that needs to hide the cursor at the beginning, and then of course show it back at the end. ShowCursor/HideCursor will work perfectly.

But what if you have another piece of code that does the same thing, but calls the previous code in the middle. By counting the number of times HideCursor has been called, it prevents the cursor from reappearing at the end of the first piece of code.

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS