namespace D3DExperiment
{
class BZWindow : Form
{
Device device;
Direct3D d3d;
private void CreateDevice()
{
d3d = new Direct3D ();
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Flip;
presentParams.DeviceWindowHandle = this.Handle;
device = new Device ( d3d , 0, DeviceType.Reference, this.Handle , CreateFlags.SoftwareVertexProcessing ,presentParams );
}
public BZWindow()
{
//this.WindowState = FormWindowState.Maximized;
//this.FormBorderStyle = FormBorderStyle.None;
}
protected override void OnPaint(PaintEventArgs e)
{
device.BeginScene ();
//zdepth and stencil
device.Clear ( ClearFlags.Target, new Color4(Color.Red) , 1 , 0 );
device.SetCursorPosition ( new Point ( 100, 100 ), false );
device.EndScene ();
device.Present ();
}
static void Main()
{
using (BZWindow window = new BZWindow())
{
window.CreateDevice ();
Application.Run ( window );
}
}
}
}
[SlimDX]Device.SetCursorPos()
I am fooling around with the Device class and I noticed the function SetCursor(). I figured it would put my mouse wherever I wanted when I called it. However, my mouse stays in the same place, what is wrong? It doesn't work in full screen either.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement