Jump to content
  • Advertisement
Sign in to follow this  
_Phalanx_

Help getting my own cursor!

This topic is 5069 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

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
Advertisement
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
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
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
If you are in Windowed mode, I suggest you try using Windows' cursorimage-changing function. SetCursor(), you load the cursor as a resource first.

Share this post


Link to post
Share on other sites
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!