static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); _xW = new xWindow(); _xW.Show(); _xW._x2D.Run(); }
public x2D(WF.Control p_container) { _container = p_container; _xWindow = (xWindow)p_container.FindForm(); _container.Resize += new EventHandler(_container_Resize); _container.SizeChanged += new EventHandler(_container_Resize); WF.Control.FromHandle(this.Window.Handle).VisibleChanged += new EventHandler(x2D_VisibleChanged); _graphics = new GraphicsDeviceManager(this); _graphics.PreferredBackBufferWidth = 1; _graphics.PreferredBackBufferHeight = 1; _graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(_graphics_PreparingDeviceSettings); Content.RootDirectory = "Content"; Mouse.WindowHandle = _container.Handle; this._graphics.SynchronizeWithVerticalRetrace = true; this.IsFixedTimeStep = false; }