Sign in to follow this  

Custom Cursor Problem [FIXED]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this