Sign in to follow this  
_Phalanx_

Help getting my own cursor!

Recommended Posts

_Phalanx_    180
Hey, I have managed to recieve input from my mouse, but i want to know how to get my own cursor goin in my window, for example, diff sensitivity and different look. basically i am asking how i can set it to let me handle my own cursor in my window and forget about the microsoft one, also i would like to be able to retreive the X and Y positions of the windows cursor before i delete it so i can initialize mine. Thanks

Share this post


Link to post
Share on other sites
Pipo DeClown    804
To disable the Windows-cursor use ShowCursor( false );.


I'd create my own Cursor-class, which loads a sprite and displays it. It would then work with the Input-class and see howmuch the mouse has moved, and then multiply it by the sensitivity.


// Load-time
(1) myCursorClass.LoadTexture( "cursor.bmp" );


// Run-time
(1) myCursorClass.UpdatePosition( &myInputClass );
// moved = real_moved_distance * sensitivity[0.5-2.0];

(2) myCursorClass.DrawCursor();

Share this post


Link to post
Share on other sites
_Phalanx_    180
alright, that seems to work well, but i have one more question now. If you set show cursor to false, then there is no cursor on the blue XP part of the window where i can minimize and exit, how do I set it so a cursor pops up when i am on these areas. Also, If i am just drawing an image to the back buffer at a point defined by the mouse, then how do i get it so the cursor doenst dissapear when i move it 5 or more pixels from the edge, thanks.

Share this post


Link to post
Share on other sites
_Phalanx_    180
i think i might understand what you mean now, did you mean just use a point sprite and set the image you want to be your cursor as a texture? if so it still doenst solve my other problem about moving the mouse onto the top bar of the window.

Share this post


Link to post
Share on other sites
Muhammad Haggag    1358
Quote:
Original post by Pipo DeClown

// Load-time
(1) myCursorClass.LoadTexture( "cursor.bmp" );


// Run-time
(1) myCursorClass.UpdatePosition( &myInputClass );
// moved = real_moved_distance * sensitivity[0.5-2.0];

(2) myCursorClass.DrawCursor();

Hmmmm...Deja Vu?
[grin]

Share this post


Link to post
Share on other sites
_Phalanx_    180
Oh and one more thing, I think AND and XOR masks only allow for black and white cursors, and ive seen many games use their own cursor so there must be a way to link a bitmap to a windows cursor

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