Ejemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            MainWindow form = new MainWindow();
            form.Show();

            Logger.Instance.log("Creating XNA Game object (GravityEditor).");

            using (GravityEditor game = new GravityEditor(form.getHandle()))
                game.Run();
        }
Ejemplo n.º 2
0
        public GravityEditor(IntPtr drawSurface)
        {
            Instance = this;

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 600;

            Content.RootDirectory = "Content";

            this.drawSurface = drawSurface;
            graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
            winform = (Forms.Form)Forms.Form.FromHandle(Window.Handle);
            winform.VisibleChanged += new EventHandler(GravityEditor_VisibleChanged);
            winform.Size = new System.Drawing.Size(10, 10);
            Mouse.WindowHandle = drawSurface;
            resizeBackBuffer(MainWindow.Instance.drawingBox.Width, MainWindow.Instance.drawingBox.Height);
            winform.Hide();
        }