private void FillGrid() { int selectionIndex = -1; gridFormats.BeginUpdate(); gridFormats.Rows.Clear(); for (int i = 0; i < formats.Length; i++) { ODGridRow row = new ODGridRow(); row.Cells.Add(formats[i].formatNumber.ToString()); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsOpenGL(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsWindow(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsBitmap(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatUsesPalette(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsAcceleration(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsDoubleBuffering(formats[i].pfd)?"Yes":"No"); row.Cells.Add(formats[i].pfd.cColorBits.ToString()); row.Cells.Add(formats[i].pfd.cDepthBits.ToString()); gridFormats.Rows.Add(row); if (formats[i].formatNumber == selectedFormatNum) { selectionIndex = i; } } gridFormats.EndUpdate(); if (selectionIndex >= 0) { gridFormats.SetSelected(selectionIndex, true); } }
private void FillGrid() { int selectionIndex = -1; gridFormats.BeginUpdate(); gridFormats.Rows.Clear(); if (this.radioDirectXChart.Checked) { textSelected.Text = ""; gridFormats.BeginUpdate(); gridFormats.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "FormatNum"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Adapter"), 60); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Accelerated"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Buffered"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "ColorBits"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "ColorFormat"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "DepthBits"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "DepthFormat"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Antialiasing"), 75); gridFormats.Columns.Add(col); gridFormats.EndUpdate(); for (int i = 0; i < xformats.Length; i++) { ODGridRow row = new ODGridRow(); row.Cells.Add((i + 1).ToString()); row.Cells.Add(xformats[i].adapterIndex.ToString()); row.Cells.Add(xformats[i].IsHardware?"Yes":"No"); //Supports hardware acceleration? row.Cells.Add("Yes"); //Supports double-buffering. All DirectX devices support double-buffering as required. row.Cells.Add(ToothChartDirectX.GetFormatBitCount(xformats[i].BackBufferFormat).ToString()); //Color bits. row.Cells.Add(xformats[i].BackBufferFormat); row.Cells.Add(ToothChartDirectX.GetFormatBitCount(xformats[i].DepthStencilFormat).ToString()); //Depth buffer bits. row.Cells.Add(xformats[i].DepthStencilFormat); row.Cells.Add(xformats[i].MultiSampleCount.ToString()); gridFormats.Rows.Add(row); if (xformats[i].ToString() == selectedDirectXFormat) { selectionIndex = i; textSelected.Text = (i + 1).ToString(); } } } else if (this.radioOpenGLChart.Checked) { textSelected.Text = selectedFormatNum.ToString(); gridFormats.BeginUpdate(); gridFormats.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g(this, "FormatNum"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "OpenGL"), 60); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Windowed"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Bitmapped"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Palette"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Accelerated"), 80); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Buffered"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "ColorBits"), 75); gridFormats.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "DepthBits"), 75); gridFormats.Columns.Add(col); gridFormats.EndUpdate(); for (int i = 0; i < formats.Length; i++) { ODGridRow row = new ODGridRow(); row.Cells.Add(formats[i].formatNumber.ToString()); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsOpenGL(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsWindow(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsBitmap(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatUsesPalette(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsAcceleration(formats[i].pfd)?"Yes":"No"); row.Cells.Add(OpenGLWinFormsControl.FormatSupportsDoubleBuffering(formats[i].pfd)?"Yes":"No"); row.Cells.Add(formats[i].pfd.cColorBits.ToString()); row.Cells.Add(formats[i].pfd.cDepthBits.ToString()); gridFormats.Rows.Add(row); if (formats[i].formatNumber == selectedFormatNum) { selectionIndex = i; } } } gridFormats.EndUpdate(); if (selectionIndex >= 0) { gridFormats.SetSelected(selectionIndex, true); } }