Cursor problem in DirectX.
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.
Have you tried the samples that come with the SDK? Do those samples behave in the same way?
Mariano Ruggiero
Lead Programmer
ONIRIC GAMES
Mariano Ruggiero
Lead Programmer
ONIRIC GAMES
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
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
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]
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]
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
-----------------------------
kevin@mayday-anime.com
http://www.mayday-anime.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement