Hi all! My first post here
I want to make a custom cursor for my game, I searched the msdn and found three functions which I think will make it happen. But I failed...
The three functions are SetCursorProperties, ShowCursor and SetCursorPosition of the Direct3D Device class. Experts here please help...
My code are as follows:
I want to make a custom cursor for my game, I searched the msdn and found three functions which I think will make it happen. But I failed...
The three functions are SetCursorProperties, ShowCursor and SetCursorPosition of the Direct3D Device class. Experts here please help...
My code are as follows:
Code:
public void Init()
{
PresentParameters presParameters = new PresentParameters();
presParameters.BackBufferCount = 1;
presParameters.Windowed = true;
presParameters.SwapEffect = SwapEffect.Discard;
graphicCard = new Device(0, DeviceType.Hardware, target,
CreateFlags.HardwareVertexProcessing,
presParameters);
System.Drawing.Bitmap bm = new System.Drawing.Bitmap(@"..\..\head.gif");
Surface s = Surface.FromBitmap(graphicCard, bm, Pool.SystemMemory);
graphicCard.SetCursorProperties(0, 0, s);
graphicCard.ShowCursor(true);
graphicCard.SetCursorPosition(0, 0, true);
}