Advertisement Jump to content
Sign in to follow this  
frankypoo

showing/hiding the cursor

This topic is 4916 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i'm going for the world of warcraft style camera, where when you hold both mouse buttons, you control the direction of your character as he moves forward. The mouse is automatically centered and the cursor disapears while you're doing this, and once you let go of both mouse buttons, the cursor reappears (in the center of the screen). So in my game I used the regular ol ShowCursor(bool) and SetCursorPos(int, int) functions; however, it takes sooo long for the cursor to dissapear and reappear. I figure IDirect3DDevice8::ShowCursor would be much faster, but for some reason I can't get it to work. I plug it in, and it compiles fine.. it just doesn't actually make the cursor dissappear/reappear. Is there some initialization that I need to do beforehand or something?

Share this post


Link to post
Share on other sites
Advertisement
It might be buffered frames, DX buffers 3 frames by default, there is a way to flush it, though I forget how right now.

Share this post


Link to post
Share on other sites
Check the debug output - it you aren't doing something right, it will definetly be in there. Also, if you just can't figure it out, you could always just draw the cursor yourself using ID3DXSprite. If you are interesting in doing animated cursors, that approach may be slightly easier.

Share this post


Link to post
Share on other sites
Quote:
Original post by frankypoo
IDirect3DDevice8::ShowCursor would be much faster, but for some reason I can't get it to work.


Check out SetCursorProperties. I believe you must call that before any of the other D3D cursor commands will work.

Share this post


Link to post
Share on other sites
Hi there Frankypoo,

[Using Managed DirectX]
Or you could use managed directx and C# and hide the cursor using Cursor.Hide();

Stay cool.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!