Example #1
0
        /// <summary>
        /// Initializes a new GameWindow class.
        /// </summary>
        /// <param name="handle">The Handle.</param>
        internal GameWindow(IntPtr handle)
        {
            _surface = (Form) Control.FromHandle(handle);
            _surfaceStyle = SurfaceStyle.Normal;
            _surfaceLayout = new SurfaceLayout(true, false, true);
            CursorVisibility = false;
            _surface.FormClosing += _surface_FormClosing;
            _surface.Activated += _surface_Activated;
            _surface.Deactivate += _surface_Deactivate;

            MethodInvoker br = delegate { _surface.KeyPreview = true; };
            _surface.Invoke(br);
        }
Example #2
0
        /// <summary>
        /// Initializes a new GameWindow class.
        /// </summary>
        /// <param name="handle">The Handle.</param>
        internal GameWindow(IntPtr handle)
        {
            _surface              = (Form)Control.FromHandle(handle);
            _surfaceStyle         = SurfaceStyle.Normal;
            _surfaceLayout        = new SurfaceLayout(true, false, true);
            CursorVisibility      = false;
            _surface.FormClosing += _surface_FormClosing;
            _surface.Activated   += _surface_Activated;
            _surface.Deactivate  += _surface_Deactivate;

            MethodInvoker br = delegate { _surface.KeyPreview = true; };

            _surface.Invoke(br);
        }