Esempio n. 1
0
        private void DrawPerformanceStats(ref ImperativeRenderer ir)
        {
            const float scale = 1f;
            var         text  = PerformanceStats.GetText(this);

            using (var buffer = BufferPool <BitmapDrawCall> .Allocate(text.Length)) {
                var layout     = Font.LayoutString(text, buffer, scale: scale);
                var layoutSize = layout.Size;
                var position   = new Vector2(30f, 30f);
                var dc         = layout.DrawCalls;

                ir.FillRectangle(
                    Bounds.FromPositionAndSize(position, layoutSize),
                    Color.Black
                    );
                ir.Layer += 1;
                ir.DrawMultiple(dc, position);
            }
        }
Esempio n. 2
0
        private void DrawPerformanceStats(SpriteBatch spriteBatch)
        {
            const float scale = 1f;
            var         text  = PerformanceStats.GetText(this);

            // FIXME
            Console.WriteLine(text);

            /*
             * using (var buffer = BufferPool<BitmapDrawCall>.Allocate(text.Length)) {
             *  var layout = Font.LayoutString(text, buffer, scale: scale);
             *  var layoutSize = layout.Size;
             *  var position = new Vector2(30f, 30f);
             *  var dc = layout.DrawCalls;
             *
             *  ir.FillRectangle(
             *      Bounds.FromPositionAndSize(position, layoutSize),
             *      Color.Black
             *  );
             *  ir.Layer += 1;
             *  ir.DrawMultiple(dc, position);
             * }
             */
        }
Esempio n. 3
0
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            PerformanceStats.Record(this);
        }