コード例 #1
0
        /// <summary>
        /// Gets the main monitor.
        /// </summary>
        /// <returns>The main monitor.</returns>
        public static IMonitor GetMainMonitor()
        {
            if (!SilkManager.IsRegistered <IWindowPlatform>())
            {
                Window.Init();
            }

            return(SilkManager.Get <IWindowPlatform>().GetMainMonitor());
        }
コード例 #2
0
        /// <summary>
        /// Gets all monitors present on this window platform.
        /// </summary>
        /// <returns>All monitors present on this window platform</returns>
        public static IEnumerable <IMonitor> GetMonitors()
        {
            if (!SilkManager.IsRegistered <IWindowPlatform>())
            {
                Window.Init();
            }

            return(SilkManager.Get <IWindowPlatform>().GetMonitors());
        }
コード例 #3
0
        /// <summary>
        /// Clears all current contexts for this backend on the current thread.
        /// </summary>
        public static void ClearCurrentContexts()
        {
            if (!SilkManager.IsRegistered <IWindowPlatform>())
            {
                Init();
            }

            SilkManager.Get <IWindowPlatform>().ClearContexts();
        }
コード例 #4
0
ファイル: Window.cs プロジェクト: tr002196/Silk.NET
        /// <summary>
        /// Create a window on the current platform.
        /// </summary>
        /// <param name="options">The window to use.</param>
        /// <returns>A Silk.NET window using the current platform.</returns>
        public static IWindow Create(WindowOptions options)
        {
            if (!SilkManager.IsRegistered <IWindowPlatform>())
            {
                Init();
            }

            // We should have a platform now, as Silk.Init would've thrown otherwise.
            // ReSharper disable once PossibleNullReferenceException
            return(SilkManager.Get <IWindowPlatform>().GetWindow(options));
        }
コード例 #5
0
        /// <summary>
        /// Create a window on the current platform.
        /// </summary>
        /// <param name="options">The window to use.</param>
        /// <returns>A Silk.NET window using the current platform.</returns>
        public static IWindow Create(WindowOptions options)
        {
            if (!SilkManager.IsRegistered <IWindowPlatform>())
            {
                Init();
            }

            if (IsViewOnly)
            {
                throw new NotSupportedException
                      (
                          "The currently bound window platform only supports views," +
                          "instead of windows. Use the view APIs instead."
                      );
            }

            // We should have a platform now, as Silk.Init would've thrown otherwise.
            // ReSharper disable once PossibleNullReferenceException
            return(SilkManager.Get <IWindowPlatform>().CreateWindow(options));
        }
コード例 #6
0
ファイル: WindowManager.cs プロジェクト: rxcomputers/Silk.NET
 /// <summary>
 /// Creates a window and adds it to this manager.
 /// </summary>
 /// <param name="opts">The options to initialize the new window with.</param>
 /// <param name="host">
 /// The window host to use. If null, the current windowing platform will be
 /// fetched using the <see cref="SilkManager"/>.
 /// </param>
 public void CreateWindow(WindowOptions opts, IWindowHost host = null)
 => AddWindow((host ?? SilkManager.Get <IWindowPlatform>()).CreateWindow(opts));
コード例 #7
0
ファイル: GL.cs プロジェクト: koson/Silk.NET
 public static GL GetApi() => LibraryLoader <GL> .Load
     (new OpenGLESLibraryNameContainer(), SilkManager.Get <GLSymbolLoader>());
コード例 #8
0
 /// <summary>
 /// Creates a window and adds it to this manager.
 /// </summary>
 /// <param name="opts">The options to initialize the new window with.</param>
 /// <param name="platform">
 /// The windowing platform to use. If null, the current windowing platform will be
 /// fetched using the <see cref="SilkManager"/>.
 /// </param>
 public void CreateWindow(WindowOptions opts, IWindowPlatform platform = null)
 => AddWindow((platform ?? SilkManager.Get <IWindowPlatform>()).GetWindow(opts));