Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
New to DirectX, My form is not displaying.
This is code I copied from a video, I have tried many examples with the same results, no form is displayed.
/// Description of MainForm.
public partial class Form1 : Form
private Device device = null;
// The InitializeComponent() call is required for Windows Forms designer support.
// TODO: Add constructor code after the InitializeComponent() call.
private void InitializeDevice()
PresentParameters pp = new PresentParameters();
pp.Windowed = true;
pp.SwapEffect = SwapEffect.Discard;
device = new Device(0, DeviceType.Reference, this, CreateFlags.SoftwareVertexProcessing, pp);
protected override void OnPaint(PaintEventArgs e)
device.Clear(ClearFlags.Target, Color.CornflowerBlue, 0, 1);
0 · ·