Jump to content
  • Advertisement
Sign in to follow this  
Tertsi

DInput cursor won't display

This topic is 5044 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
Advertisement
In the SDK, the ShowCursor(TRUE) function is between the SetCursor(NULL) and return true calls. Maybe this is picky about that.

Chris

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
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!