You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
613 B

using gaemstone.ECS;
using Silk.NET.Maths;
using Silk.NET.OpenGL;
using Silk.NET.Windowing;
namespace gaemstone.Client;
[Module]
public class Windowing
{
[Component]
public class Canvas
{
public GL GL { get; }
public Canvas(GL gl) => GL = gl;
public Vector2D<int> Size { get; set; }
public Color BackgroundColor { get; set; }
}
[Component]
public class GameWindow
{
public IWindow Handle { get; }
public GameWindow(IWindow handle) => Handle = handle;
}
[System(Phase.PreFrame)]
public static void ProcessWindow(GameWindow window, Canvas canvas)
=> canvas.Size = window.Handle.Size;
}