Advertisement Jump to content
Sign in to follow this  

Custom Cursor Problem [FIXED]

This topic is 4886 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

Hello, been doing good so far on this DirectX 8 - > DirectX 9 changeover... but ran into a snag. I'm trying to get the custom cursor to work. The mouse itself works (did point tests), however the custom cursor will not display. The mouse position only works if I comment out the last line of this source, otherwise with it in it will not update the mouse and will fail at the same line.. here's the relevent code (error testing code was removed):

(protected member variable)
  LPDIRECT3DSURFACE9 m_pCursorSurf;     // the main cursor surface
  LPDIRECTINPUTDEVICE8 m_pMouseDev;     // DirectInput device pointer

(inside init member function)

g_pDI->CreateDevice(GUID_SysMouse, &m_pMouseDev, NULL);

// here is where I get the error
r = g_pDevice->SetCursorProperties(0,0,m_pCursorSurf);
        return E_FAIL;

I fail on the line "g_pDevice->SetCursorProperties", r is equal to -2005530516 (or D3DERR_INVALIDCALL). I did HRESULT tests on all the lines above it, and all of them came back as S_OK. I know a cursor surface is highly sensitive in what format it can be, the image is A8R8G8B8 .dds surface 32x32 (built by the texture tool). It seems that surface creation in DX9 is a little different than DX8, did I miss a step? Thanks in advanced [Edited by - necreia on September 5, 2005 6:09:45 PM]

Share this post

Link to post
Share on other sites
Fix it myself, I did a typo:



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!