Axiom.RenderSystems.Xna.XnaHelper.GetDriverInfo C# (CSharp) Méthode

GetDriverInfo() public static méthode

Enumerates driver information and their supported display modes.
public static GetDriverInfo ( ) : DriverCollection
Résultat DriverCollection
		public static DriverCollection GetDriverInfo()
		{
			DriverCollection driverList = new DriverCollection();

			foreach ( XFG.GraphicsAdapter adapterInfo in XFG.GraphicsAdapter.Adapters )
			{
				Driver driver = new Driver( adapterInfo );

				int lastWidth = 0, lastHeight = 0;
				XFG.SurfaceFormat lastFormat = 0;

				foreach ( XFG.DisplayMode mode in adapterInfo.SupportedDisplayModes )
				{
					// filter out lower resolutions, and make sure this isnt a dupe (ignore variations on refresh rate)
					if ( ( mode.Width >= 640 && mode.Height >= 480 ) &&
						( ( mode.Width != lastWidth ) || mode.Height != lastHeight || mode.Format != lastFormat ) )
					{
						// add the video mode to the list
						driver.VideoModes.Add( new VideoMode( mode ) );

						// save current mode settings for comparison on the next iteraion
						lastWidth = mode.Width;
						lastHeight = mode.Height;
						lastFormat = mode.Format;
					}
				}
				driverList.Add( driver );
			}

			return driverList;
		}