Exemplo n.º 1
0
		/// <summary>
		///		Enumerates driver information and their supported display modes.
		/// </summary>
		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;
		}
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="vCommands.CommandHost"/> class.
 /// </summary>
 public CommandHost(int maxDepth = 1000)
 {
     Library       = new Library();
     ManualDrivers = new DriverCollection();
     ShortHelp     = false;
     MaxDepth      = maxDepth;
 }
Exemplo n.º 3
0
        public static void Register(Library l, DriverCollection d)
        {
            l.Add(mans);

            d.Add(OutputDriver.Instance);
            d.SetDefault(OutputDriver.Instance);
        }
Exemplo n.º 4
0
		/// <summary>
		///		Enumerates driver information and their supported display modes.
		/// </summary>
		public static DriverCollection GetDriverInfo()
		{
			var driverList = new DriverCollection();

#if SILVERLIGHT
			switch (GraphicsDeviceManager.Current.RenderModeReason)
			{
				case RenderModeReason.GPUAccelerationDisabled:
					MessageBox.Show("GPU hardware acceleration is disabled. Set 'EnableGPUAcceleration' to true in the hosting HTML page and 'Use GPU Acceleration' in Out-of-Browser settings", "GPUAccelerationDisabled", MessageBoxButton.OK);
					break;
				case RenderModeReason.Not3DCapable:
					MessageBox.Show("The graphics card is not 3D capable.", "Not3DCapable", MessageBoxButton.OK);
					break;
				case RenderModeReason.SecurityBlocked:                                
					MessageBox.Show("Right-click menu, open Silverlight Configuration, go to the Permissions panel and allow 3D Graphics", "SecurityBlocked", MessageBoxButton.OK);
					break;
				case RenderModeReason.TemporarilyUnavailable:
					MessageBox.Show("Device is temporarily unavailable.", "TemporarilyUnavailable", MessageBoxButton.OK);
					break;
				case RenderModeReason.Normal:
					driverList.Add(new Driver(GraphicsDeviceManager.Current.GraphicsDevice.Adapter));
					break;
			}
#else
			foreach (var adapterInfo in GraphicsAdapter.Adapters)
			{
				var driver = new Driver( adapterInfo );

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

				foreach ( var 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 );
			}
#endif

			return driverList;
		}
Exemplo n.º 5
0
        public async Task <Player[]> GetDriversAsync()
        {
            DriverCollection result = null;
            var url      = string.Format("{0}/{1}", Common.Constants.BaseApiUrl, Common.Constants.PlayersApiUrl);
            var response = await client.GetAsync(url);

            if (response.IsSuccessStatusCode)
            {
                result = await response.Content.ReadAsAsync <DriverCollection>();
            }

            return(result?.players);
        }
Exemplo n.º 6
0
		protected virtual void Dispose(bool disposing)
		{
			if (!disposed)
			{
				if (disposing)
				{
					if (drivers != null)
					{
						drivers.Dispose();
						drivers = null;
					}
					
					if (recordDrivers != null)
					{
						recordDrivers.Dispose();
						recordDrivers = null;
					}
					
					if (masterChannelGroup != null)
					{
						masterChannelGroup.Dispose();
						masterChannelGroup = null;
					}
					
					if (dspHead != null)
					{
						dspHead.Dispose();
						dspHead = null;
					}
				}
				
				if (handle != IntPtr.Zero)
				{
					NativeMethods.FMOD_System_Release(handle);
					handle = IntPtr.Zero;
				}
			}
			disposed = true;
		}
Exemplo n.º 7
0
		/// <summary>
		///		Enumerates driver information and their supported display modes.
		/// </summary>
		public static DriverCollection GetDriverInfo( D3D.Direct3D manager )
		{
			DriverCollection driverList = new DriverCollection();

			foreach ( D3D.AdapterInformation adapterInfo in manager.Adapters )
			{
				List<D3D.DisplayMode> displaymodeList = new List<D3D.DisplayMode>();
				Driver driver = new Driver( adapterInfo.Adapter,
                    adapterInfo.GetCaps(DeviceType.Hardware), adapterInfo.Details, adapterInfo.CurrentDisplayMode);

				int lastWidth = 0, lastHeight = 0;
				D3D.Format lastFormat = 0;

				// 32bit Modes
				foreach ( D3D.DisplayMode mode in adapterInfo.GetDisplayModes( D3D.Format.X8R8G8B8 ) )
				{
					displaymodeList.Add( mode );
				}

				// 16Bit modes
				foreach ( D3D.DisplayMode mode in adapterInfo.GetDisplayModes( D3D.Format.R5G6B5 ) )
				{
					displaymodeList.Add( mode );
				}

				foreach ( D3D.DisplayMode mode in displaymodeList )
				{
					// 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.VideoModeList.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;
		}