Beispiel #1
0
        public Game()
        {
            renderForm            = new RenderForm("D3D11 Planets");
            renderForm.MouseMove += (object sender, System.Windows.Forms.MouseEventArgs e) => {
                realMousePos = new Vector2(e.Location.X, e.Location.Y);
            };
            renderForm.WindowState        = System.Windows.Forms.FormWindowState.Maximized;
            renderForm.AllowUserResizing  = true;
            renderForm.ClientSizeChanged += (object sender, EventArgs e) => {
                resizePending = true;
            };

            DInput.DirectInput directInput = new DInput.DirectInput();
            keyboard = new DInput.Keyboard(directInput);
            mouse    = new DInput.Mouse(directInput);

            keyboard.Acquire();
            mouse.Acquire();

            renderer = new Renderer(this, renderForm);

            Shaders.Load(renderer.Device, renderer.Context);
            Resources.Load(renderer.Device);

            Initialize();
        }
Beispiel #2
0
        public void Dispose()
        {
            // scene stuff
            StarSystem.ActiveSystem.Dispose();
            skybox.Dispose();
            ControlPanel.Dispose();

            Shaders.Dispose();
            Resources.Dispose();

            // other stuff
            keyboard.Dispose();
            mouse.Dispose();

            renderer.Dispose();
            renderForm.Dispose();
        }