コード例 #1
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
        /// <summary>
        /// Returns an array of handles for all currently connected monitors.
        /// The primary monitor is always first in the returned array. If no
        /// monitors were found, this function returns Null.
        /// </summary>
        /// <returns>
        /// An array of monitor handles, or Null if no monitors were found or
        /// if an error occurred.
        /// </returns>
        public static MonitorHandle[] GetMonitors()
        {
            MonitorHandle *monitorPointer = GetMonitors(out int count);

            var result = new MonitorHandle[count];

            for (int i = 0; i < count; i++)
            {
                result[i] = monitorPointer[i];
            }

            return(result);
        }
コード例 #2
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
        /// <summary>
        /// Returns an array of all video modes supported by the specified
        /// monitor. The returned array is sorted in ascending order, first by
        /// color bit depth (the sum of all channel depths) and then by
        /// resolution area (the product of width and height).
        /// </summary>
        /// <param name="monitor">
        /// The monitor to query.
        /// </param>
        /// <returns>
        /// An array of video modes, or Null if an error occurred.
        /// </returns>
        public static VideoMode[] GetVideoModes(MonitorHandle monitor)
        {
            VideoMode *videoModePointer = GetVideoModes(monitor, out int count);

            var result = new VideoMode[count];

            for (int i = 0; i < count; i++)
            {
                result[i] = videoModePointer[i];
            }

            return(result);
        }
コード例 #3
0
        internal Window(int width, int height, string title, MonitorHandle monitor, Dictionary <WindowAttribute, int> windowHints)
        {
            try
            {
                ErrorUtility.Bind();

                if (windowHints != null)
                {
                    foreach (var hintPair in windowHints)
                    {
                        Glfw3.WindowHint(hintPair.Key, hintPair.Value);
                    }
                }

                this.handle = Glfw3.CreateWindow(width, height, title, monitor, WindowHandle.Zero);

                ErrorUtility.ThrowOnError();
            }
            finally
            {
                ErrorUtility.Unbind();
            }
        }
コード例 #4
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
 public static extern WindowHandle CreateWindow(int width, int height, [MarshalAs(UnmanagedType.LPStr)] string title, MonitorHandle monitor, WindowHandle share);
コード例 #5
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
 public static extern void SetGamma(MonitorHandle monitor, float gamma);
コード例 #6
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
 public static extern VideoModePointer GetVideoMode(MonitorHandle monitor);
コード例 #7
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
 public static extern VideoMode *GetVideoModes(MonitorHandle monitor, out int count);
コード例 #8
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
 public static extern NativeString GetMonitorName(MonitorHandle monitor);
コード例 #9
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
 public static extern void GetMonitorPhysicalSize(MonitorHandle monitor, out int widthMm, out int heightMm);
コード例 #10
0
ファイル: Glfw3.cs プロジェクト: Tommsy64/SharpVk
 public static extern void GetMonitorPos(MonitorHandle monitor, out int xPos, out int yPos);
コード例 #11
0
ファイル: Monitor.cs プロジェクト: oscar-broman/SharpVk
 /// <summary>
 /// Creates a new instance of Monitor from a given monitor handle.
 /// </summary>
 /// <param name="handle">
 /// The monitor handle to use.
 /// </param>
 public Monitor(MonitorHandle handle)
 {
     this.handle = handle;
 }
コード例 #12
0
ファイル: Glfw3.cs プロジェクト: yongweisun/SharpVk
 public static extern string glfwGetMonitorName(MonitorHandle monitor);