Archived

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

Daishim

Cursor problem in DirectX.

Recommended Posts

Daishim    244
I''ve run a search on this and found that others have had the same problem and the threads lead on and on to nowhere but don''t ever answer the original question that is at hand. When I''m running a DirectDraw program that I''ve created, I move the cursor into the window and the cursor gets stuck on a resize icon, or if the cursor is in the window on load up (ie in fullscreen mode) it is just the busy hourglass. I have set the cursor icon to IDC_ARROW in the window class. Anyone know what''s up with this and/or how to fix it? Thanks.

Share this post


Link to post
Share on other sites
KurtCPP    130
Howdy.
First you wont have any fucking resize cursors and things lke those if you specify the WS_POPUP style for your window instead of WS_Something_with_borders. You''ll see, that''s quite efficient. You can also find tricks to fool Windows into thinking the cursor is still on the client area by overriding the WM_NCHITTEST message (Non-Client Hit Test).
Second, you may not want to waste your time looking for the samples of DX SDK since they all use a class which code Ive never been able to find (actually you may find the basic code but you''ll have to look in every nook and cranny of your CD and of your PC [good luck])
One more thing, Ive been told that its standard use to have a picture instead of a true cursor. You gotta blit it on top of each frame so that you dont have any lags causing artifacts while refreshing the screen.
Hope I ve been useful.

Prog, Hex & Rock''n''Roll :
I don''t like the Prog but the Prog likes me.
Some nice poetry to sweeten your spirit and relax a bit before programming

Share this post


Link to post
Share on other sites
drdlord    122
as was said use ws_popup if you can.

if your doing a re-sizable window like I am for my map editor add "LoadCursor(NULL, IDC_ARROW)" to your WNDCLASSEX structure (make sure it's in the right spot I acedently put it as my icon once...) oh and if your not doing so already call your render function in wm_paint (check that your device isn't null first) as well as in your main program loop. If you have non-d3d windows too call DefWindowProc in wm_paint too to handle them

[edited by - drdlord on August 8, 2003 3:53:40 PM]

Share this post


Link to post
Share on other sites
grasshopa55    128
A general rule of thumb when dealing with mouse cursors and DirectX, DirectDraw especially, is to not use the main GDI cursor, but create a bitmapped cursor image and display it where the cursor normally would me. This will allow you to use the Win32 Message Pump to catch any messages, but alleviate the problems around the cursor behaving unexpectedly. This technique is extremely useful, but requires basic knowledge of DirectInput. I''m sure there are plenty of threads here regarding this subject, some of which I started. Also, be sure to check out Google as well.

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

Share this post


Link to post
Share on other sites