Jump to content
  • Advertisement

Archived

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

FlamePixel

Custom Cursor?

This topic is 5493 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
Advertisement
There is a whole section regarding this issue in the "the Zen of Direct3D game programming".

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!