Exemplo n.º 1
0
 /// <summary>
 /// Dispose all statically cached value by this instance.
 /// </summary>
 public static void Dispose()
 {
     lock (StaticLock)
     {
         staticCollector.Dispose();
         adapters = null;
         defaultAdapter = null;
         isInitialized = false;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of <see cref="GraphicsOutput" />.
        /// </summary>
        /// <param name="adapter">The adapter.</param>
        /// <param name="outputIndex">Index of the output.</param>
        /// <exception cref="System.ArgumentNullException">output</exception>
        /// <exception cref="ArgumentOutOfRangeException">output</exception>
        internal GraphicsOutput(GraphicsAdapter adapter, int outputIndex)
        {
            if (adapter == null) throw new ArgumentNullException("adapter");

            this.outputIndex = outputIndex;
            this.adapter = adapter;
            this.output = adapter.NativeAdapter.GetOutput(outputIndex).DisposeBy(this);
            outputDescription = output.Description;

            unsafe
            {
                var rectangle = outputDescription.DesktopBounds;
                desktopBounds = *(Rectangle*)&rectangle;
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 /// <param name="adapter">The graphics adapter.</param>
 /// <param name="profile">The graphics profile.</param>
 protected void Initialize(GraphicsAdapter adapter, GraphicsProfile profile, PresentationParameters presentationParameters, object windowHandle)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GraphicsDevice" /> class.
 /// </summary>
 /// <param name="adapter">The adapter.</param>
 /// <param name="creationFlags">The creation flags.</param>
 /// <param name="windowHandle">The window handle.</param>
 /// <param name="graphicsProfiles">The graphics profiles.</param>
 /// <returns>An instance of <see cref="GraphicsDevice" /></returns>
 public static GraphicsDevice New(GraphicsAdapter adapter, DeviceCreationFlags creationFlags = DeviceCreationFlags.None, WindowHandle windowHandle = null, params GraphicsProfile[] graphicsProfiles)
 {
     return(new GraphicsDevice(adapter ?? GraphicsAdapterFactory.Default, graphicsProfiles, creationFlags, windowHandle));
 }