All pastes #930152 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-06 10:06 UTC
rendered paste body
private void frmMain_Load(object sender, EventArgs e)
        {
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.Opaque, true);
            MinimumSize = new System.Drawing.Size(Width - ClientSize.Width + 1,
                                                  Height - ClientSize.Height + 1);

            presentParams.IsFullScreen = false;
            presentParams.BackBufferCount = 1;
            presentParams.SwapEffect = SwapEffect.Discard;
            presentParams.BackBufferWidth = ClientSize.Width;
            presentParams.BackBufferHeight = ClientSize.Height;

            device = new GraphicsDevice(GraphicsAdapter.DefaultAdapter,
                                        DeviceType.Hardware,
                                        this.Handle,
                                        presentParams);
            //Странно, работает только если false
            //device.SoftwareVertexProcessing = true;
        }