Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
 public ParmeEmitterGroup(Random random)
 {
     _emitterRenderGroup = new MonoGameEmitterRenderGroup(FlatRedBallServices.GraphicsDevice);
     _random             = random;
 }