Example #1
0
        /// <summary>
        ///     Makes a transparent Fullscreen window
        /// </summary>
        /// <param name="limitFps">VSync</param>
        /// <exception cref="Exception">Could not create OverlayWindow</exception>
        public DirectXOverlayWindow(bool limitFps = true)
        {
            IsDisposing = false;
            IsVisible   = true;
            IsTopMost   = true;

            ParentWindowExists = false;

            X      = 0;
            Y      = 0;
            Width  = NativeUtils.GetSystemMetrics(SmCxScreen);
            Height = NativeUtils.GetSystemMetrics(SmCyScreen);

            ParentWindow = IntPtr.Zero;

            if (!CreateWindow())
            {
                throw new Exception("Could not create OverlayWindow");
            }

            Graphics = new Direct2DRenderer(Handle, limitFps);

            SetBounds(X, Y, Width, Height);
        }