I try to follow their examples on github and i just want to draw a line. But when the window opens, there only a blackscreen. I dont know what i did wrong.
Here is my source code. Thank you for helping !
static void Main()
{
var form = new RenderForm("Test");
int width = form.ClientSize.Width;
int height = form.ClientSize.Height;
var device = new Device(new Direct3D(), 0, DeviceType.Hardware, form.Handle, CreateFlags.HardwareVertexProcessing, new PresentParameters(width, height) { PresentationInterval = PresentInterval.One });
Line line = new Line(device);
RawVector2[] vertices =
{
new RawVector2(10, 10),
new RawVector2(10, 10)
};
RenderLoop.Run(form, () =>
{
device.Clear(ClearFlags.Target, new RawColorBGRA(0, 0, 0, 1), 1.0f, 0);
device.BeginScene();
line.Width = 10;
line.GLLines = true;
line.Antialias = false;
line.Draw(vertices, new RawColorBGRA(254, 254, 254, 1));
device.EndScene();
device.Present();
});
}