Archived

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

Custom Cursor?

This topic is 5278 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 would like the cursor to show in my fullscreen DirectX 8 program. If possible, I would like to load the cursor from an external source (bmp, jpg, ect...). I would appreciate any information on this subject. Thank you for your time.

Share this post


Link to post
Share on other sites
Yep.
I haven''t tried it but m_pd3dDevice->ShowCursor( TRUE ), where m_pd3dDevice is a valid IDirect3DDevice9 interface should do the trick.
It''s all in the SDK documentation.

Share this post


Link to post
Share on other sites
It doesn''t seem to be working... It should go in my Init code after I create the IDirect3DDevice8 object, right? Does it matter what WindowClass.hCursor is? Currently, I''ve set it to NULL.

Share this post


Link to post
Share on other sites
Actually, I don''t think that putting it in init will do the job. You should put in the message loop in the handler of WM_SETCURSOR.
(from the SDK docs) :

 
case WM_SETCURSOR:
// Turn off window cursor

SetCursor( NULL );
m_pd3dDevice->ShowCursor( TRUE );
return TRUE; // prevent Windows from setting cursor to window class cursor

break;

Share this post


Link to post
Share on other sites
Wow! That''s too easy! I remember making a surface for the cursor (2d sprite technique) and having to use directinput to handle it.. i guess Microsoft made a good wrapper for diectx since dx7

Share this post


Link to post
Share on other sites
I think you still have to use directInput to capture the movement of the mouse and call SetCursorPosition.
Also, if you want a custom bitmap you still need to call SetCursorProperties and give it a pointer to a surface you created earlier.
The real question is :
why am I answering a question about something I know absolutely nothing about?

Share this post


Link to post
Share on other sites
I always use exclusive mode for fullscreen, but that causes problems if my program crashes(which it often does). What should be used instead of exclusive mode? Surely there''s a better mode, that isn''t so.............exclusive.

Share this post


Link to post
Share on other sites
That''s odd. I always use DISCL_FOREGROUND|DISCL_EXCLUSIVE, and when my program crashes it just goes back to MSVC without problems.

Share this post


Link to post
Share on other sites