Archived

This topic is now archived and is closed to further replies.

Advanced Coders Only, Coding Problem

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

I''ve been expirimenting with DirectX in a windowed mode... I''ve made a window, set the style as WS_OVERLAPPEDWINDOW so that I can resize and move, etc.... I have DirectDraw set on the normal cooperative level. I attached a clipper to the window using SetHWnd() function, and associated this to my primary surface, this way my clipper follows the window around automatically, in the client area. I detect x and y positions of the window client area, then I''m using double buffering to blit, and imitate page flipping. The only problem is, whenever I blit the buffer onto the primary surface, it covers up my mouse cursor. Then I only have a mouse cursor outside of the client area of the window. This is unacceptable. I''ve tried using my own mouse cursor, just blitting one, but this limits my mouse cursor movement to the boundaries of the clipping region. Does anyone know a cure for this problem? I would be very grateful. Sincerely, Tony Chamblee

Share this post


Link to post
Share on other sites
I don''t use DX but I think you have to hide the cursor, then blit to the primary buffer, then show the cursor.

Try using ShowCursor(TRUE) and ShowCursor(FALSE)

Share this post


Link to post
Share on other sites
If you want to get rid of the cursor disappearing/flickering issue, you need to use your own cursor and draw it when ever you blit to the primary surface. Your cursor will only appear when the mouse is over your client area. This is the natural behavior of a "Windowed" application. So you can get rid of the flicker, but as for the cursor movement in the clipping region, that is also correct. Your custom cursor will only be drawn in the clipping region.

Kevin

-----------------------------
kevin@mayday-anime.com
http://dainteractive.mayday-anime.com

Share this post


Link to post
Share on other sites


I have formed a solution to this problem.

Kevin...

Your solution would have been inappropriate because I am implementing windows controls into my application. If I had blitted my own mouse cursor, it would not appear on top of those controls, nor the system menu at the top of the window.

I failed to mention that I was implementing windows controls, my fault.



Share this post


Link to post
Share on other sites


I have formed a solution to this problem.

Kevin...

Your solution would have been inappropriate because I am implementing windows controls into my application. If I had blitted my own mouse cursor, it would not appear on top of those controls, nor the system menu at the top of the window.

I failed to mention that I was implementing windows controls, my fault.



Share this post


Link to post
Share on other sites