static void Main(string[] args) { MainForm form = new MainForm(); form.Show(); EditorLoop editorLoop = new EditorLoop(form.getDrawSurface()); editorLoop.Run(); }
public EditorLoop(IntPtr drawSurface) { _editorLoopInstance = this; graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; GameSettings.Initialise(); GameSettings.ApplyChanges(ref graphics); this.drawSurface = drawSurface; graphics.PreparingDeviceSettings += new EventHandler <PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings); winform = (Form)Form.FromHandle(Window.Handle); winform.VisibleChanged += new EventHandler(EditorLoop_VisibleChanged); winform.Size = new System.Drawing.Size(10, 10); Mouse.WindowHandle = drawSurface; resizebackbuffer(MainForm.Default.GameView.Width, MainForm.Default.GameView.Height); winform.Hide(); }