Help getting my own cursor!

Started by
6 comments, last by _Phalanx_ 19 years, 8 months ago
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
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();
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.
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.
If you are in Windowed mode, I suggest you try using Windows' cursorimage-changing function. SetCursor(), you load the cursor as a resource first.
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]

how do i get a new image for the cursor for that? do i have to personally write XOR and AND maps for it?
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

This topic is closed to new replies.

Advertisement