public SetViewportSize ( int viewportWidth, int viewportHeight ) : void | ||
viewportWidth | int | |
viewportHeight | int | |
return | void |
private void MeshControl_Resize(object sender, EventArgs e) { if (!Loaded) { return; } ActiveCamera.SetViewportSize(tabs.Width, tabs.Height); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); meshControl.SwapBuffers(); }
private void CameraBox_ItemCheck(object sender, ItemCheckEventArgs e) { //https://social.msdn.microsoft.com/Forums/windows/en-US/5333cdf2-a669-467c-99ae-1530e91da43a/checkedlistbox-allow-only-one-item-to-be-selected?forum=winforms if (e.NewValue == CheckState.Checked) { for (var ix = 0; ix < cameraBox.Items.Count; ++ix) { if (e.Index != ix) { cameraBox.ItemCheck -= CameraBox_ItemCheck; cameraBox.SetItemChecked(ix, false); cameraBox.ItemCheck += CameraBox_ItemCheck; } } // Make a copy of the camera ActiveCamera = new Camera(cameraBox.Items[e.Index] as Camera); ActiveCamera.SetViewportSize(meshControl.Width, meshControl.Height); // Repaint meshControl.Update(); } else if (e.CurrentValue == CheckState.Checked && cameraBox.CheckedItems.Count == 1) { e.NewValue = CheckState.Checked; } }