Пример #1
0
 public InputHandler(EditorUiController uiController,
                     ParticleCamera camera,
                     SettingsCommandHandler commandHandler,
                     AppOperationQueue appOperationQueue,
                     ApplicationState applicationState)
 {
     _uiController      = uiController;
     _camera            = camera;
     _commandHandler    = commandHandler;
     _appOperationQueue = appOperationQueue;
     _applicationState  = applicationState;
 }
Пример #2
0
        protected override void Initialize()
        {
            _applicationState          = new ApplicationState(_graphicsDeviceManager.GraphicsDevice);
            _emitterSpriteBatchHandler = new EmitterSpriteBatchHandler(_graphicsDeviceManager.GraphicsDevice);
            _graphicsDeviceManager.PreferredBackBufferWidth  = 1024;
            _graphicsDeviceManager.PreferredBackBufferHeight = 768;
            _graphicsDeviceManager.ApplyChanges();

            _gridTexture = SetupGridTexture(GraphicsDevice, 32);
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _textureFileLoader  = new TextureFileLoader(GraphicsDevice, _applicationState);
            _emitterRenderGroup = new MonoGameEmitterRenderGroup(GraphicsDevice);

            ResetRenderTarget();
            ResetCamera();
            _applicationState.Zoom = 1;

            var monoGameImGuiRenderer = new MonoGameImGuiRenderer(this);

            _imGuiManager = new ImGuiManager(monoGameImGuiRenderer);
            _uiController = new EditorUiController(_imGuiManager,
                                                   _commandHandler,
                                                   _appOperationQueue,
                                                   _applicationState,
                                                   _textureFileLoader,
                                                   monoGameImGuiRenderer);

            _inputHandler = new InputHandler(_uiController, _camera, _commandHandler, _appOperationQueue, _applicationState);
            _inputHandler.ResetCameraAndEmitterRequested += (sender, args) => ResetCamera(true);

            _uiController.WindowResized(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);

            _appOperationQueue.Enqueue(new UpdateMiscOptionsRequested
            {
                UpdatedSamplerState = SamplerState.PointClamp,
            });

            base.Initialize();
        }