Sign in to follow this  

DInput cursor won't display

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

Am I doing the following correctly?
D3DXLoadSurfaceFromFileA(cursor, NULL, NULL, "temp\\extract.tmp", NULL, D3DX_FILTER_NONE, D3DCOLOR_XRGB(255, 0, 255), NULL);

MGEgfxref->lpdevice->SetCursorProperties(0,0,cursor);
MGEgfxref->lpdevice->ShowCursor(TRUE);

// And cursor is: LPDIRECT3DSURFACE9	cursor;



// elsewhere
switch( msg )
    {
		case WM_SETCURSOR:
			// Turn off window cursor. 
			SetCursor(NULL);
			return true; // Prevent Windows from setting cursor to window class cursor.
			break;
	}

// elsewhere
MGEgfxref->lpdevice->SetCursorPosition(mousepos.x, mousepos.y, D3DCURSOR_IMMEDIATE_UPDATE);


and I'm frequently getting the mousepos using DInput. Yet for somereason I can't get the custom cursor to show up. (It's a 32x32 .bmp which has been extracted to that "temp\\extract.tmp".) Sorry for kinda double posting but I didn't seem to get a reply by replying to my old post. [Edited by - Tertsi on August 26, 2004 6:40:58 AM]

Share this post


Link to post
Share on other sites
Xegoth I tried that but there are many problems when trying to do it that way and it won't work.. (Unless you consider a flashing screen good.)

Well Supernat the problem is that I can't access the lpdevice anyway in the msg handler function. (Cause you can't change the arguments and the lpdevice is a private class object...)

Share this post


Link to post
Share on other sites
Quote:
Original post by TertsiWell Supernat the problem is that I can't access the lpdevice anyway in the msg handler function. (Cause you can't change the arguments and the lpdevice is a private class object...)

But you CAN access the SetCursor() function in your DI function.

Share this post


Link to post
Share on other sites
Yes but when the msg handler receives the WM_SETCURSOR msg it will change the damn cursorstate anyway. I tried to put an if statement which would make the msg handler not to get the WM_SETCURSOR msg but can't compare if(msg != WM_SETCURSOR)...

Anybody who has a working custom cursor & Dinput mouse system?

Share this post


Link to post
Share on other sites
Just curious, what did you do to fix it? Was it a directory structure problem, a mouse coordinates problem, did you not have the cursor surface created, or something else?

Chris

[Edited by - Supernat02 on August 28, 2004 12:25:54 AM]

Share this post


Link to post
Share on other sites

This topic is 4860 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.

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