this.gbZoom = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.btnResetView = new System.Windows.Forms.Button();
+ this.cbAA = new System.Windows.Forms.CheckBox();
this.chkWireFrame = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.ctxObjects = new System.Windows.Forms.ContextMenuStrip(this.components);
//
this.gbZoom.Controls.Add(this.label2);
this.gbZoom.Controls.Add(this.btnResetView);
+ this.gbZoom.Controls.Add(this.cbAA);
this.gbZoom.Controls.Add(this.chkWireFrame);
this.gbZoom.Controls.Add(this.label1);
this.gbZoom.Controls.Add(this.scrollZoom);
this.btnResetView.UseVisualStyleBackColor = true;
this.btnResetView.Click += new System.EventHandler(this.btnReset_Click);
//
+ // cbAA
+ //
+ this.cbAA.AutoSize = true;
+ this.cbAA.Location = new System.Drawing.Point(89, 32);
+ this.cbAA.Name = "cbAA";
+ this.cbAA.Size = new System.Drawing.Size(82, 17);
+ this.cbAA.TabIndex = 21;
+ this.cbAA.Text = "Anti-aliasing";
+ this.cbAA.UseVisualStyleBackColor = true;
+ //
// chkWireFrame
//
this.chkWireFrame.AutoSize = true;
this.returnToolStripMenuItem,
this.deleteToolStripMenuItem});
this.ctxObjects.Name = "ctxObjects";
- this.ctxObjects.Size = new System.Drawing.Size(153, 142);
+ this.ctxObjects.Size = new System.Drawing.Size(110, 120);
this.ctxObjects.Opening += new System.ComponentModel.CancelEventHandler(this.ctxObjects_Opening);
//
// touchToolStripMenuItem
//
this.touchToolStripMenuItem.Name = "touchToolStripMenuItem";
- this.touchToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.touchToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.touchToolStripMenuItem.Text = "Touch";
this.touchToolStripMenuItem.Click += new System.EventHandler(this.touchToolStripMenuItem_Click);
//
// sitToolStripMenuItem
//
this.sitToolStripMenuItem.Name = "sitToolStripMenuItem";
- this.sitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.sitToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.sitToolStripMenuItem.Text = "Sit";
this.sitToolStripMenuItem.Click += new System.EventHandler(this.sitToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
- this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
+ this.toolStripMenuItem1.Size = new System.Drawing.Size(106, 6);
//
// takeToolStripMenuItem
//
this.takeToolStripMenuItem.Name = "takeToolStripMenuItem";
- this.takeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.takeToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.takeToolStripMenuItem.Text = "Take";
this.takeToolStripMenuItem.Click += new System.EventHandler(this.takeToolStripMenuItem_Click);
//
// returnToolStripMenuItem
//
this.returnToolStripMenuItem.Name = "returnToolStripMenuItem";
- this.returnToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.returnToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.returnToolStripMenuItem.Text = "Return";
this.returnToolStripMenuItem.Click += new System.EventHandler(this.returnToolStripMenuItem_Click);
//
// deleteToolStripMenuItem
//
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
- this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.deleteToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.deleteToolStripMenuItem.Text = "Delete";
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
//
public System.Windows.Forms.HScrollBar scrollYaw;
public System.Windows.Forms.HScrollBar scrollZoom;
public System.Windows.Forms.GroupBox gbZoom;
- private System.Windows.Forms.CheckBox chkWireFrame;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Button btnResetView;
- private System.Windows.Forms.Label label2;
public System.Windows.Forms.ContextMenuStrip ctxObjects;
- private System.Windows.Forms.ToolStripMenuItem touchToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem sitToolStripMenuItem;
- private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
- private System.Windows.Forms.ToolStripMenuItem takeToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem returnToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
+ public System.Windows.Forms.CheckBox cbAA;
+ public System.Windows.Forms.CheckBox chkWireFrame;
+ public System.Windows.Forms.Label label1;
+ public System.Windows.Forms.Button btnResetView;
+ public System.Windows.Forms.Label label2;
+ public System.Windows.Forms.ToolStripMenuItem touchToolStripMenuItem;
+ public System.Windows.Forms.ToolStripMenuItem sitToolStripMenuItem;
+ public System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
+ public System.Windows.Forms.ToolStripMenuItem takeToolStripMenuItem;
+ public System.Windows.Forms.ToolStripMenuItem returnToolStripMenuItem;
+ public System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
}
}
/// <summary>
/// Use multi sampling (anti aliasing)
/// </summary>
- public bool UseMultiSampling = false;
+ public bool UseMultiSampling = true;
/// <summary>
/// Is rendering engine ready and enabled
InitializeComponent();
Disposed += new EventHandler(frmPrimWorkshop_Disposed);
AutoSavePosition = true;
+ UseMultiSampling = cbAA.Checked = instance.GlobalSettings["use_multi_sampling"];
+ cbAA.CheckedChanged += cbAA_CheckedChanged;
this.instance = instance;
}
else
{
- for (int aa = 0; aa <= 8; aa += 2)
+ for (int aa = 0; aa <= 4; aa += 2)
{
var testMode = new OpenTK.Graphics.GraphicsMode(OpenTK.DisplayDevice.Default.BitsPerPixel, 24, 8, aa);
if (testMode.Samples == aa)
GLMode = null;
}
- if (GLMode == null)
- {
- Logger.Log("Failed to initialize OpenGL control", Helpers.LogLevel.Error, Client);
- return;
- }
-
- Logger.Log("Initializing OpenGL mode: " + GLMode.ToString(), Helpers.LogLevel.Info);
+
try
{
- glControl = new OpenTK.GLControl(GLMode);
+ if (GLMode == null)
+ {
+ // Try default mode
+ glControl = new OpenTK.GLControl();
+ }
+ else
+ {
+ glControl = new OpenTK.GLControl(GLMode);
+ }
}
- catch
+ catch (Exception ex)
{
+ Logger.Log(ex.Message, Helpers.LogLevel.Warning, Client);
glControl = null;
}
- if (glControl == null) return;
+ if (glControl == null)
+ {
+ Logger.Log("Failed to initialize OpenGL control, cannot continue", Helpers.LogLevel.Error, Client);
+ return;
+ }
+
+ Logger.Log("Initializing OpenGL mode: " + GLMode.ToString(), Helpers.LogLevel.Info);
glControl.Paint += glControl_Paint;
glControl.Resize += glControl_Resize;
}
}
}
+
+ private void cbAA_CheckedChanged(object sender, EventArgs e)
+ {
+ instance.GlobalSettings["use_multi_sampling"] = UseMultiSampling = cbAA.Checked;
+ SetupGLControl();
+ }
+
#endregion Form controls handlers
+ #region Context menu
private void ctxObjects_Opening(object sender, System.ComponentModel.CancelEventArgs e)
{
if (instance.State.IsSitting)
}
Close();
}
+ #endregion Context menu
+
}