use arrows to flip through loaded images

This commit is contained in:
Colin McMillen 2023-06-29 19:12:40 -04:00
parent 20f8b1e285
commit 6fc66aba8f

View File

@ -128,7 +128,7 @@ public class Texture : IDisposable {
public Texture(string path) {
Image<Rgba32> image = Image.Load<Rgba32>(path);
Console.WriteLine($"{image.Width}x{image.Height}");
Console.WriteLine($"image loaded: {image.Width}x{image.Height}");
//foreach (IExifValue exif in image.Metadata.ExifProfile.Values) {
// Console.WriteLine($"{exif.Tag} : {exif.GetValue()}");
//}
@ -205,6 +205,17 @@ public class Game : GameWindow {
if (input.IsKeyDown(Keys.Escape)) {
Close();
}
if (input.IsKeyPressed(Keys.Down)) {
if (textureIndex < textures.Count - 1) {
textureIndex++;
}
}
if (input.IsKeyPressed(Keys.Up)) {
if (textureIndex > 0) {
textureIndex--;
}
}
}
protected override void OnLoad() {
@ -292,7 +303,6 @@ static class Program {
}
}
Console.WriteLine($"best monitor: {bestMonitor.HorizontalResolution}x{bestMonitor.VerticalResolution}");
Console.WriteLine($"{bestMonitor.ClientArea}, {bestMonitor.WorkArea}");
GameWindowSettings gwSettings = new GameWindowSettings();
gwSettings.RenderFrequency = 60.0;