Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] SetCursor, SetCursorProperties ...

Started by x_igor_x Dec 16, 2005 at 3:06 AM 4 replies 3.1k views
Original Post
x_igor_x
x_igor_x
I am unable to change cursor in my c# DX application based on DX SDK framework(December 2005). is there any working example for this for managed code? is there something that is not mentioned in SDK docs? Tnx!
x_igor_x
x_igor_x
Quote:
Original post by Anonymous Poster
Do cursors work independently of the frame rate? Sorry, I haven't used them yet.


You can hide widow cursor and draw your own, but then it depends on frame rate.

I want to use windows cursor in my project to have faster and more precise mouse
Shinkage
Shinkage
Works the same in managed code as it does in unmanaged code so far as I'm aware. Device.SetCursorProperties will change the cursor to any supplied Direct3D Surface object, Device.SetCursorPosition will set its position. What, precisely, is the trouble you're having?

And to the AP, yes cursors are framerate independent... I believe you're guaranteed the cursor to be updated at least at half your current video refresh rate, but I could be wrong about that.
x_igor_x
x_igor_x
Cursor does not change when i call SetCursor. It seems there's more to it

Cursor cursor = new Cursor("C:\\Documents and Settings\\usr1\\Desktop\\3dsmove.cur");
MyDevice.SetCursor( cursor, true);
Talonius
Talonius
Quote:
Original post by x_igor_x
Cursor does not change when i call SetCursor. It seems there's more to it

Cursor cursor = new Cursor("C:\\Documents and Settings\\usr1\\Desktop\\3dsmove.cur");
MyDevice.SetCursor( cursor, true);

The second argument in SetCursor appears to be a "watermark" argument. It doesn't specify that the cursor should be shown.

The examples I've seen are along the lines of...
Cursor cursor = new Cursor(cursorFilename);device.SetCursor(cursor, false);device.ShowCursor(true);
The Set/Show pattern is repeated everywhere. Perhaps try adding a ShowCursor call directly after you set the cursor.



..what we do will echo throughout eternity..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.