예제 #1
0
 public WindowsGameForm()
 {
     base.SuspendLayout();
     base.AutoScaleDimensions = new SizeF(6f, 13f);
     base.AutoScaleMode       = AutoScaleMode.Font;
     base.CausesValidation    = false;
     base.ClientSize          = new Size(0x124, 0x10a);
     base.Name               = "GameForm";
     this.Text               = "GameForm";
     base.ResizeBegin       += new EventHandler(this.Form_ResizeBegin);
     base.ClientSizeChanged += new EventHandler(this.Form_ClientSizeChanged);
     base.Resize            += new EventHandler(this.Form_Resize);
     base.LocationChanged   += new EventHandler(this.Form_LocationChanged);
     base.ResizeEnd         += new EventHandler(this.Form_ResizeEnd);
     base.MouseEnter        += new EventHandler(this.Form_MouseEnter);
     base.MouseLeave        += new EventHandler(this.Form_MouseLeave);
     base.ResumeLayout(false);
     try
     {
         this.freezeOurEvents   = true;
         this.resizeWindowState = base.WindowState;
         this.screen            = WindowsGameWindow.ScreenFromHandle(base.Handle);
         base.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, false);
         base.ClientSize = new Size(GameWindow.DefaultClientWidth, GameWindow.DefaultClientHeight);
         this.UpdateBorderStyle();
     }
     finally
     {
         this.freezeOurEvents = false;
     }
 }
예제 #2
0
 private bool IsWindowOnAdapter(IntPtr windowHandle, GraphicsAdapter adapter)
 {
     return(WindowsGameWindow.ScreenFromAdapter(adapter) == WindowsGameWindow.ScreenFromHandle(windowHandle));
 }