コード例 #1
0
        ///<Summary>Get all formats for the grid based on the current filters.</Summary>
        private void RefreshFormats()
        {
            this.Cursor = Cursors.WaitCursor;
            OpenGLWinFormsControl contextFinder = new OpenGLWinFormsControl();

            //Get raw formats.
            Gdi.PIXELFORMATDESCRIPTOR[] rawformats = OpenGLWinFormsControl.GetPixelFormats(contextFinder.GetHDC());
            if (checkAllFormats.Checked)
            {
                formats = new OpenGLWinFormsControl.PixelFormatValue[rawformats.Length];
                for (int i = 0; i < rawformats.Length; i++)
                {
                    formats[i] = new OpenGLWinFormsControl.PixelFormatValue();
                    formats[i].formatNumber = i + 1;
                    formats[i].pfd          = rawformats[i];
                }
            }
            else
            {
                //Prioritize formats as requested by the user.
                formats = OpenGLWinFormsControl.PrioritizePixelFormats(rawformats, checkDoubleBuffering.Checked, checkHardwareAccel.Checked);
            }
            contextFinder.Dispose();
            //Update the format grid to reflect possible changes in formats.
            FillGrid();
            this.Cursor = Cursors.Default;
        }
コード例 #2
0
        private void radio3DChart_Click(object sender, EventArgs e)
        {
            group3DToothChart.Enabled = true;
            //pick the best pixel format, completely ignoring the filters.
            OpenGLWinFormsControl autoFormat = new OpenGLWinFormsControl();

            OpenGLWinFormsControl.PixelFormatValue pfv = OpenGLWinFormsControl.ChoosePixelFormatEx(autoFormat.GetHDC());
            autoFormat.Dispose();
            selectedFormatNum = pfv.formatNumber;
            textSelected.Text = selectedFormatNum.ToString();
            RefreshFormats();
        }
コード例 #3
0
ファイル: FormGraphics.cs プロジェクト: kjb7749/testImport
 ///<Summary>Get all formats for the grid based on the current filters.</Summary>
 private void RefreshFormats()
 {
     this.Cursor = Cursors.WaitCursor;
     gridFormats.Rows.Clear();
     gridFormats.Invalidate();
     textSelected.Text = "";
     Application.DoEvents();
     if (this.radioDirectXChart.Checked)
     {
         xformats = ToothChartDirectX.GetStandardDeviceFormats();
     }
     else if (this.radioOpenGLChart.Checked)
     {
         OpenGLWinFormsControl contextFinder = new OpenGLWinFormsControl();
         //Get raw formats.
         Gdi.PIXELFORMATDESCRIPTOR[] rawformats = OpenGLWinFormsControl.GetPixelFormats(contextFinder.GetHDC());
         if (checkAllFormats.Checked)
         {
             formats = new OpenGLWinFormsControl.PixelFormatValue[rawformats.Length];
             for (int i = 0; i < rawformats.Length; i++)
             {
                 formats[i] = new OpenGLWinFormsControl.PixelFormatValue();
                 formats[i].formatNumber = i + 1;
                 formats[i].pfd          = rawformats[i];
             }
         }
         else
         {
             //Prioritize formats as requested by the user.
             formats = OpenGLWinFormsControl.PrioritizePixelFormats(rawformats, checkDoubleBuffering.Checked, checkHardwareAccel.Checked);
         }
         contextFinder.Dispose();
     }
     //Update the format grid to reflect possible changes in formats.
     FillGrid();
     this.Cursor = Cursors.Default;
 }