Custom Cursor?

Started by
13 comments, last by FlamePixel 20 years, 9 months ago
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.
Advertisement
There is a whole section regarding this issue in the "the Zen of Direct3D game programming".
_________ Evious Ltd.
I do not own that book. Is there a way for my program to just use the default windows cursor?
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.
_________ Evious Ltd.
I''m using 8, but it should have the same function. I''ll try that. Thank you for your reply.
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.
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 cursorbreak;
_________ Evious Ltd.
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

The nightmare travels across the cosmos with his burning mane. The trail of ash that is produced.

?Have a nice day!?

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?
_________ Evious Ltd.
It''s still not working...

This topic is closed to new replies.

Advertisement