Jump to content
  • Advertisement
Sign in to follow this  
SCarvenger

Multiple Cursor

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

How can i display two or more cursors in the screen? I tought of: 1) Drawing directly in the screen DC, but as i "move" the recently created cursor it makes a track because the area that the cursor was doesnt gets repainted...

Share this post


Link to post
Share on other sites
Advertisement
It's not possible.
You can save a copy of the screen where your cursor enters and repaint it when you leave; but you can't obtain an updated image without asking directly the application(s) which paints on the DC.

Share this post


Link to post
Share on other sites
The user only moves one mouse, so there is only one cursor. You can of course have more than one cursor image, but you only want to manually draw (i.e. directly to DC) the images that don't correspond to the one the user is moving. When you "make the second cursor", draw a cursor image where the cursor is currently, move the cursor to the new position, and change the cursor icon (if desired).

Share this post


Link to post
Share on other sites
Quote:
The user only moves one mouse, so there is only one cursor.
well if you have two users with two mouses, then you will need two cursors as well. For example if one do a multiplayer game ... :)

So this question is something that I also have a problem with :).

Share this post


Link to post
Share on other sites
Quote:
Original post by joe_bubamara
Quote:
The user only moves one mouse, so there is only one cursor.
well if you have two users with two mouses, then you will need two cursors as well. For example if one do a multiplayer game ... :)

So this question is something that I also have a problem with :).
Windows combines the input from all mice connected to the PC into one, so you'll still only get one cursor. If you need to read input from multiple devices, you should look into raw input (Which is a Win32 concept), or whatever is appropriate for the language you're using.
In any case, it'll mean drawing the cursor image yourself. Although, if the OP was rendering two cursor images in one application, there shouldn't be a problem. It sounds to me like he wants to be able to create a fake cursor image and move that around the desktop rather than an app window.

Share this post


Link to post
Share on other sites
yest steve, it's all correct, but not even raw_input will give you two cursors, so it is right that one has to draw cursor himself as well;

I am not sure if you can draw two cursor images even on desktop, but with some keyboard hook it might be possible as well.

This is actually next thing to investigate on my todo list :), as soon as I sort out some issue with raw_input and it reporting multiple devices when there are not (& I am not talking about RDP devices).

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!