Sign in to follow this  
Tertsi

setting SetCursorPosition flag off

Recommended Posts

Why do these two lines do the same thing although D3DCURSOR_IMMEDIATE_UPDATE is defined as 1? lpdevice->SetCursorPosition(mousepos.x, mousepos.y, D3DCURSOR_IMMEDIATE_UPDATE); lpdevice->SetCursorPosition(mousepos.x, mousepos.y, 0); What I'm trying to achieve here is that the cursor position wouldn't update without a call to Present(). So how can I set the flag off?

Share this post


Link to post
Share on other sites
From the SDK:

Some video cards implement hardware color cursors. This flag does not have an effect on these cards.

Have you looked into this? Perhaps there's another way to achieve what you want. What exactly do you need to do? Maybe you could store a flag that gets set after a present, then you call SetPosition if the flag is set and then reset the flag. This would achieve the same thing.

Chris

Share this post


Link to post
Share on other sites
Okay thanks, I just wanted to know that the flag isn't on for no reason. It's not a big deal that it updates it without a present call really.. but that's how it would normally work without the hardware cursorpos updating. Even if you do try to achieve it your way, the cursor will update anyway. But not with the DINPUT mousesens, instead at the Win cursor rate.

Share this post


Link to post
Share on other sites
To fix that you can catch the WM_SETCURSOR message and set it to NULL. I forgot to mention that, sorry.

case WM_SETCURSOR:
SetCursor(NULL);
return true;

This would go in your WndProc to keep windows from updating it.

Chris

Share this post


Link to post
Share on other sites
Eh, that way it won't display any cursors and I can't get my input class object pointer to the function. So I can't put the DX showcursor function or whatever there (I tested that like month ago.. So I must settle for ignoring it like this; if(msg == WM_SETCURSOR) return 0; (My game only responds to two cases in the handler so I don't use a switch statement.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this