feat: basic sdl3 basic windowing

This commit is contained in:
2026-01-26 12:25:38 +03:00
parent 02130d8324
commit 18ac6b23fd
3 changed files with 408 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
using Engine.Core;
namespace Engine.Integration.SDL3;
public interface IWindow : IBehaviour
{
Event<IWindow, StateChangedArguments> OnStateChanged { get; }
Event<IWindow, FocusStateChangedArguments> OnFocusStateChanged { get; }
Event<IWindow, ModeChangedArguments> OnModeChanged { get; }
Event<IWindow, ShowStateChangedArguments> OnShowStateChanged { get; }
Event<IWindow, ResizeModeChangedArguments> OnResizeModeChanged { get; }
Event<IWindow, TitleChangedArguments> OnTitleChanged { get; }
Event<IWindow, TargetFpsChangedArguments> OnTargetFpsChanged { get; }
Event<IWindow, SizeChangedArguments> OnSizeChanged { get; }
Event<IWindow, BackgroundColorChangedArguments> OnBackgroundColorChanged { get; }
WindowState State { get; set; }
WindowFocusState FocusState { get; }
WindowMode Mode { get; set; }
WindowShowState ShowState { get; set; }
WindowResizeMode ResizeMode { get; set; }
string Title { get; set; }
uint TargetFps { get; set; }
Vector2DInt Size { get; set; }
ColorRGB BackgroundColor { get; set; }
readonly record struct StateChangedArguments(WindowState PreviousState);
readonly record struct FocusStateChangedArguments(WindowFocusState PreviousFocusState);
readonly record struct ModeChangedArguments(WindowMode PreviousMode);
readonly record struct ShowStateChangedArguments(WindowShowState PreviousShowState);
readonly record struct ResizeModeChangedArguments(WindowResizeMode PreviousResizeMode);
readonly record struct TitleChangedArguments(string PreviousTitle);
readonly record struct TargetFpsChangedArguments(uint PreviousTargetFps);
readonly record struct SizeChangedArguments(Vector2DInt PreviousSize);
readonly record struct BackgroundColorChangedArguments(ColorRGB PreviousColor);
}
public enum WindowFocusState
{
Focused,
Unfocused
}
public enum WindowState
{
Open,
Closed
}
public enum WindowMode
{
Windowed,
Fullscreen,
BorderlessFullscreen,
BorderlessWindowed
}
public enum WindowShowState
{
Normal,
Minimized,
Maximized
}
public enum WindowResizeMode
{
Fixed,
Resizable,
AspectLocked
}