Compare commits

..

2 Commits

Author SHA1 Message Date
f83d7f13aa FpsCounter frameTimes size: 60 -> 30 2023-07-26 11:25:14 -04:00
a92d089c5b add poadding to top of statusbar 2023-07-26 11:24:56 -04:00

View File

@ -19,7 +19,7 @@ using System.Xml.Linq;
namespace SemiColinGames;
public class FpsCounter {
private readonly int[] frameTimes = new int[60];
private readonly int[] frameTimes = new int[30];
private double fps = 0;
private int idx = 0;
@ -504,6 +504,7 @@ public static class Util {
return texture;
}
// FIXME: make a real icon stored as a PNG...
public static OpenTK.Windowing.Common.Input.Image[] RenderAppIcon() {
int size = 64;
Font font = SystemFonts.CreateFont("MS Mincho", size, FontStyle.Bold);
@ -803,11 +804,12 @@ public class Game : GameWindow {
}
// Draw status box.
int statusPadding = 2;
DrawFilledBox(geometry.StatusBox, Color4.Black);
DrawText(activePhoto.Description(), geometry.StatusBox.Min.X + 80, geometry.StatusBox.Min.Y);
DrawText($" FPS: {fpsCounter.Fps}", geometry.StatusBox.Max.X - 76, geometry.StatusBox.Min.Y);
DrawText(activePhoto.Description(), geometry.StatusBox.Min.X + 80, geometry.StatusBox.Min.Y + statusPadding);
DrawText($" FPS: {fpsCounter.Fps}", geometry.StatusBox.Max.X - 76, geometry.StatusBox.Min.Y + statusPadding);
if (activePhoto.Loaded) {
DrawText($"{(scale * 100):F1}%", geometry.StatusBox.Min.X, geometry.StatusBox.Min.Y);
DrawText($"{(scale * 100):F1}%", geometry.StatusBox.Min.X, geometry.StatusBox.Min.Y + statusPadding);
}
SwapBuffers();