コード例 #1
0
ファイル: App.cs プロジェクト: ibrahim-elsakka/ImGuiHandler
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            _imGuiManager.RenderElements(gameTime.ElapsedGameTime);

            base.Draw(gameTime);
        }
コード例 #2
0
        protected override void Draw(GameTime gameTime)
        {
            var backgroundColorVector = _applicationState.BackgroundColor;
            var backgroundColor       = new Color(backgroundColorVector.X,
                                                  backgroundColorVector.Y,
                                                  backgroundColorVector.Z);

            GraphicsDevice.Clear(backgroundColor);

            _graphicsDeviceManager.GraphicsDevice.SetRenderTarget(_particleRenderArea);
            RenderGrid(backgroundColor);
            RenderReferenceSprite();
            _emitterRenderGroup.Render(_camera, _applicationState.RenderSamplerState ?? SamplerState.PointClamp);
            _graphicsDeviceManager.GraphicsDevice.SetRenderTarget(null);

            var position = new Point();

            if (_applicationState.ActiveEmitter != null)
            {
                position.X = EmitterSettingsController.ActiveEditorWidth;
                position.Y = EmitterSettingsController.WorkbenchHeight - EmitterSettingsController.MenuBarSize;
            }

            _spriteBatch.Begin();
            _spriteBatch.Draw(_particleRenderArea,
                              new Rectangle(position,
                                            new Point(_particleRenderArea.Width, _particleRenderArea.Height)),
                              Color.White);

            _spriteBatch.End();

            GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
            _imGuiManager.RenderElements(gameTime.ElapsedGameTime);

            base.Draw(gameTime);
        }
コード例 #3
0
 public void Draw(TimeSpan timeSinceLastFrame)
 {
     _imGuiManager.RenderElements(timeSinceLastFrame);
 }