Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.DirectX.Direct3D;
- using System.Drawing;
- using System.Windows.Forms;
- namespace Direct3D_Course
- {
- public partial class Form1 : Form
- {
- private Device device;
- public Form1()
- {
- InitializeComponent();
- }
- public void InitializeDevice()
- {
- PresentParameters presentParams = new PresentParameters();
- presentParams.Windowed = true;
- presentParams.SwapEffect = SwapEffect.Discard;
- device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- device.Clear(ClearFlags.Target, Color.Azure, 1.0f, 0);
- device.Present();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment