/// <summary> /// Initializes a new instance of the <see cref="GraphicsAdapter" /> class. /// </summary> /// <param name="adapterOrdinal">The adapter ordinal.</param> private GraphicsAdapter(int adapterOrdinal) { this.adapterOrdinal = adapterOrdinal; adapter = ToDispose(Factory.GetAdapter1(adapterOrdinal)); Description = adapter.Description1; var outputs = adapter.Outputs; outputs1 = new GraphicsOutput[outputs.Length]; for (var i = 0; i < outputs.Length; i++) outputs1[i] = new GraphicsOutput(outputs[i]); }
private void TryAddDeviceFromOutput(GameGraphicsParameters prefferedParameters, GraphicsOutput output, GraphicsDeviceInformation deviceInfo, List<GraphicsDeviceInformation> graphicsDeviceInfos) { if (output.CurrentDisplayMode != null) AddDevice(output.CurrentDisplayMode, deviceInfo, prefferedParameters, graphicsDeviceInfos); if (prefferedParameters.IsFullScreen) { // Get display mode for the particular width, height, pixelformat foreach (var displayMode in output.SupportedDisplayModes) AddDevice(displayMode, deviceInfo, prefferedParameters, graphicsDeviceInfos); } }
private void TryAddDeviceFromOutput(GameGraphicsParameters prefferedParameters, GraphicsOutput output, GraphicsDeviceInformation deviceInfo, List<GraphicsDeviceInformation> graphicsDeviceInfos) { var preferredMode = new DisplayMode(prefferedParameters.PreferredBackBufferFormat, prefferedParameters.PreferredBackBufferWidth, prefferedParameters.PreferredBackBufferHeight, prefferedParameters.PreferredRefreshRate); if (prefferedParameters.IsFullScreen) { var displayMode = output.FindClosestMatchingDisplayMode(prefferedParameters.PreferredGraphicsProfile, preferredMode); AddDevice(displayMode, deviceInfo, prefferedParameters, graphicsDeviceInfos); } else { AddDevice(preferredMode, deviceInfo, prefferedParameters, graphicsDeviceInfos); } }