From 5c75c3b5c64eb66c23655357a758b960a05b8145 Mon Sep 17 00:00:00 2001 From: Dylan Perks <11160611+Perksey@users.noreply.github.com> Date: Thu, 3 Aug 2023 23:24:45 +0000 Subject: [PATCH 01/12] nugget likes the fidgity spinny --- .../Internals/ViewImplementationBase.cs | 6 ++++++ .../Silk.NET.Windowing.Common.csproj | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs index 580a587d8f..7e0533b5c0 100644 --- a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs +++ b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs @@ -164,6 +164,12 @@ protected VideoMode CachedVideoMode // Game loop implementation public virtual void Run(Action onFrame) { +#ifdef NET7_0_OR_GREATER + if (System.Runtime.Intrinsics.X86Base.IsSupported) + { + System.Runtime.Intrinsics.X86Base.Pause(); + } +#endif while (!IsClosing) { onFrame(); diff --git a/src/Windowing/Silk.NET.Windowing.Common/Silk.NET.Windowing.Common.csproj b/src/Windowing/Silk.NET.Windowing.Common/Silk.NET.Windowing.Common.csproj index a7eb3e435c..5bc19a3438 100644 --- a/src/Windowing/Silk.NET.Windowing.Common/Silk.NET.Windowing.Common.csproj +++ b/src/Windowing/Silk.NET.Windowing.Common/Silk.NET.Windowing.Common.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netstandard2.1 + netstandard2.0;netstandard2.1;net7.0 8.0 true Silk.NET.Windowing From f316c80de8c27ed1b463c9e15601b799b6931437 Mon Sep 17 00:00:00 2001 From: Dylan Perks <11160611+Perksey@users.noreply.github.com> Date: Thu, 3 Aug 2023 23:25:13 +0000 Subject: [PATCH 02/12] DON'T FORGET ABOUT THE PUBLIC API YOU SILLY GOOSE --- .../PublicAPI/net7.0/PublicAPI.Shipped.txt | 250 ++++++++++++++++++ .../PublicAPI/net7.0/PublicAPI.Unshipped.txt | 9 + 2 files changed, 259 insertions(+) create mode 100644 src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Shipped.txt create mode 100644 src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Unshipped.txt diff --git a/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Shipped.txt b/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Shipped.txt new file mode 100644 index 0000000000..257c914b4b --- /dev/null +++ b/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Shipped.txt @@ -0,0 +1,250 @@ +#nullable enable +Silk.NET.Windowing.APIVersion +Silk.NET.Windowing.APIVersion.APIVersion() -> void +Silk.NET.Windowing.APIVersion.APIVersion(int majorVersion, int minorVersion) -> void +Silk.NET.Windowing.APIVersion.APIVersion(System.Version! version) -> void +Silk.NET.Windowing.APIVersion.MajorVersion -> int +Silk.NET.Windowing.APIVersion.MinorVersion -> int +Silk.NET.Windowing.ContextAPI +Silk.NET.Windowing.ContextAPI.None = 0 -> Silk.NET.Windowing.ContextAPI +Silk.NET.Windowing.ContextAPI.OpenGL = 2 -> Silk.NET.Windowing.ContextAPI +Silk.NET.Windowing.ContextAPI.OpenGLES = 3 -> Silk.NET.Windowing.ContextAPI +Silk.NET.Windowing.ContextAPI.Vulkan = 1 -> Silk.NET.Windowing.ContextAPI +Silk.NET.Windowing.ContextFlags +Silk.NET.Windowing.ContextFlags.Debug = 1 -> Silk.NET.Windowing.ContextFlags +Silk.NET.Windowing.ContextFlags.Default = 0 -> Silk.NET.Windowing.ContextFlags +Silk.NET.Windowing.ContextFlags.ForwardCompatible = 2 -> Silk.NET.Windowing.ContextFlags +Silk.NET.Windowing.ContextProfile +Silk.NET.Windowing.ContextProfile.Compatability = 1 -> Silk.NET.Windowing.ContextProfile +Silk.NET.Windowing.ContextProfile.Core = 0 -> Silk.NET.Windowing.ContextProfile +Silk.NET.Windowing.GraphicsAPI +Silk.NET.Windowing.GraphicsAPI.API.get -> Silk.NET.Windowing.ContextAPI +Silk.NET.Windowing.GraphicsAPI.API.set -> void +Silk.NET.Windowing.GraphicsAPI.Flags.get -> Silk.NET.Windowing.ContextFlags +Silk.NET.Windowing.GraphicsAPI.Flags.set -> void +Silk.NET.Windowing.GraphicsAPI.GraphicsAPI() -> void +Silk.NET.Windowing.GraphicsAPI.GraphicsAPI(Silk.NET.Windowing.ContextAPI api, Silk.NET.Windowing.APIVersion apiVersion) -> void +Silk.NET.Windowing.GraphicsAPI.GraphicsAPI(Silk.NET.Windowing.ContextAPI api, Silk.NET.Windowing.ContextProfile profile, Silk.NET.Windowing.ContextFlags flags, Silk.NET.Windowing.APIVersion apiVersion) -> void +Silk.NET.Windowing.GraphicsAPI.Profile.get -> Silk.NET.Windowing.ContextProfile +Silk.NET.Windowing.GraphicsAPI.Profile.set -> void +Silk.NET.Windowing.GraphicsAPI.Version.get -> Silk.NET.Windowing.APIVersion +Silk.NET.Windowing.GraphicsAPI.Version.set -> void +Silk.NET.Windowing.IMonitor +Silk.NET.Windowing.IMonitor.Bounds.get -> Silk.NET.Maths.Rectangle +Silk.NET.Windowing.IMonitor.Gamma.get -> float +Silk.NET.Windowing.IMonitor.Gamma.set -> void +Silk.NET.Windowing.IMonitor.GetAllVideoModes() -> System.Collections.Generic.IEnumerable! +Silk.NET.Windowing.IMonitor.Index.get -> int +Silk.NET.Windowing.IMonitor.Name.get -> string! +Silk.NET.Windowing.IMonitor.VideoMode.get -> Silk.NET.Windowing.VideoMode +Silk.NET.Windowing.IView +Silk.NET.Windowing.IView.Close() -> void +Silk.NET.Windowing.IView.Closing -> System.Action? +Silk.NET.Windowing.IView.ContinueEvents() -> void +Silk.NET.Windowing.IView.DoEvents() -> void +Silk.NET.Windowing.IView.DoRender() -> void +Silk.NET.Windowing.IView.DoUpdate() -> void +Silk.NET.Windowing.IView.FocusChanged -> System.Action? +Silk.NET.Windowing.IView.FramebufferResize -> System.Action>? +Silk.NET.Windowing.IView.FramebufferSize.get -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.IView.Handle.get -> nint +Silk.NET.Windowing.IView.Initialize() -> void +Silk.NET.Windowing.IView.Invoke(System.Delegate! d, params object![]! args) -> object! +Silk.NET.Windowing.IView.IsClosing.get -> bool +Silk.NET.Windowing.IView.IsInitialized.get -> bool +Silk.NET.Windowing.IView.Load -> System.Action? +Silk.NET.Windowing.IView.PointToClient(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.IView.PointToFramebuffer(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.IView.PointToScreen(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.IView.Render -> System.Action? +Silk.NET.Windowing.IView.Reset() -> void +Silk.NET.Windowing.IView.Resize -> System.Action>? +Silk.NET.Windowing.IView.Run(System.Action! onFrame) -> void +Silk.NET.Windowing.IView.Time.get -> double +Silk.NET.Windowing.IView.Update -> System.Action? +Silk.NET.Windowing.IViewProperties +Silk.NET.Windowing.IViewProperties.API.get -> Silk.NET.Windowing.GraphicsAPI +Silk.NET.Windowing.IViewProperties.FramesPerSecond.get -> double +Silk.NET.Windowing.IViewProperties.FramesPerSecond.set -> void +Silk.NET.Windowing.IViewProperties.IsContextControlDisabled.get -> bool +Silk.NET.Windowing.IViewProperties.IsContextControlDisabled.set -> void +Silk.NET.Windowing.IViewProperties.IsEventDriven.get -> bool +Silk.NET.Windowing.IViewProperties.IsEventDriven.set -> void +Silk.NET.Windowing.IViewProperties.PreferredBitDepth.get -> Silk.NET.Maths.Vector4D? +Silk.NET.Windowing.IViewProperties.PreferredDepthBufferBits.get -> int? +Silk.NET.Windowing.IViewProperties.PreferredStencilBufferBits.get -> int? +Silk.NET.Windowing.IViewProperties.Samples.get -> int? +Silk.NET.Windowing.IViewProperties.ShouldSwapAutomatically.get -> bool +Silk.NET.Windowing.IViewProperties.ShouldSwapAutomatically.set -> void +Silk.NET.Windowing.IViewProperties.Size.get -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.IViewProperties.UpdatesPerSecond.get -> double +Silk.NET.Windowing.IViewProperties.UpdatesPerSecond.set -> void +Silk.NET.Windowing.IViewProperties.VideoMode.get -> Silk.NET.Windowing.VideoMode +Silk.NET.Windowing.IViewProperties.VSync.get -> bool +Silk.NET.Windowing.IViewProperties.VSync.set -> void +Silk.NET.Windowing.IWindow +Silk.NET.Windowing.IWindow.BorderSize.get -> Silk.NET.Maths.Rectangle +Silk.NET.Windowing.IWindow.FileDrop -> System.Action? +Silk.NET.Windowing.IWindow.IsClosing.get -> bool +Silk.NET.Windowing.IWindow.IsClosing.set -> void +Silk.NET.Windowing.IWindow.Monitor.get -> Silk.NET.Windowing.IMonitor? +Silk.NET.Windowing.IWindow.Monitor.set -> void +Silk.NET.Windowing.IWindow.Move -> System.Action>? +Silk.NET.Windowing.IWindow.Parent.get -> Silk.NET.Windowing.IWindowHost? +Silk.NET.Windowing.IWindow.SetWindowIcon(System.ReadOnlySpan icons) -> void +Silk.NET.Windowing.IWindow.StateChanged -> System.Action? +Silk.NET.Windowing.IWindowHost +Silk.NET.Windowing.IWindowHost.CreateWindow(Silk.NET.Windowing.WindowOptions opts) -> Silk.NET.Windowing.IWindow! +Silk.NET.Windowing.IWindowPlatform +Silk.NET.Windowing.IWindowPlatform.ClearContexts() -> void +Silk.NET.Windowing.IWindowPlatform.GetMainMonitor() -> Silk.NET.Windowing.IMonitor! +Silk.NET.Windowing.IWindowPlatform.GetMonitors() -> System.Collections.Generic.IEnumerable! +Silk.NET.Windowing.IWindowPlatform.GetView(Silk.NET.Windowing.ViewOptions? opts = null) -> Silk.NET.Windowing.IView! +Silk.NET.Windowing.IWindowPlatform.IsApplicable.get -> bool +Silk.NET.Windowing.IWindowPlatform.IsSourceOfView(Silk.NET.Windowing.IView! view) -> bool +Silk.NET.Windowing.IWindowPlatform.IsViewOnly.get -> bool +Silk.NET.Windowing.IWindowProperties +Silk.NET.Windowing.IWindowProperties.IsVisible.get -> bool +Silk.NET.Windowing.IWindowProperties.IsVisible.set -> void +Silk.NET.Windowing.IWindowProperties.Position.get -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.IWindowProperties.Position.set -> void +Silk.NET.Windowing.IWindowProperties.SharedContext.get -> Silk.NET.Core.Contexts.IGLContext? +Silk.NET.Windowing.IWindowProperties.Size.get -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.IWindowProperties.Size.set -> void +Silk.NET.Windowing.IWindowProperties.Title.get -> string! +Silk.NET.Windowing.IWindowProperties.Title.set -> void +Silk.NET.Windowing.IWindowProperties.TransparentFramebuffer.get -> bool +Silk.NET.Windowing.IWindowProperties.WindowBorder.get -> Silk.NET.Windowing.WindowBorder +Silk.NET.Windowing.IWindowProperties.WindowBorder.set -> void +Silk.NET.Windowing.IWindowProperties.WindowClass.get -> string? +Silk.NET.Windowing.IWindowProperties.WindowState.get -> Silk.NET.Windowing.WindowState +Silk.NET.Windowing.IWindowProperties.WindowState.set -> void +Silk.NET.Windowing.Monitor +Silk.NET.Windowing.VideoMode +Silk.NET.Windowing.VideoMode.RefreshRate.get -> int? +Silk.NET.Windowing.VideoMode.Resolution.get -> Silk.NET.Maths.Vector2D? +Silk.NET.Windowing.VideoMode.VideoMode() -> void +Silk.NET.Windowing.VideoMode.VideoMode(int refreshRate) -> void +Silk.NET.Windowing.VideoMode.VideoMode(Silk.NET.Maths.Vector2D? resolution = null, int? refreshRate = null) -> void +Silk.NET.Windowing.ViewOptions +Silk.NET.Windowing.ViewOptions.API.get -> Silk.NET.Windowing.GraphicsAPI +Silk.NET.Windowing.ViewOptions.API.set -> void +Silk.NET.Windowing.ViewOptions.FramesPerSecond.get -> double +Silk.NET.Windowing.ViewOptions.FramesPerSecond.set -> void +Silk.NET.Windowing.ViewOptions.IsContextControlDisabled.get -> bool +Silk.NET.Windowing.ViewOptions.IsContextControlDisabled.set -> void +Silk.NET.Windowing.ViewOptions.IsEventDriven.get -> bool +Silk.NET.Windowing.ViewOptions.IsEventDriven.set -> void +Silk.NET.Windowing.ViewOptions.PreferredBitDepth.get -> Silk.NET.Maths.Vector4D? +Silk.NET.Windowing.ViewOptions.PreferredBitDepth.set -> void +Silk.NET.Windowing.ViewOptions.PreferredDepthBufferBits.get -> int? +Silk.NET.Windowing.ViewOptions.PreferredDepthBufferBits.set -> void +Silk.NET.Windowing.ViewOptions.PreferredStencilBufferBits.get -> int? +Silk.NET.Windowing.ViewOptions.PreferredStencilBufferBits.set -> void +Silk.NET.Windowing.ViewOptions.Samples.get -> int? +Silk.NET.Windowing.ViewOptions.Samples.set -> void +Silk.NET.Windowing.ViewOptions.ShouldSwapAutomatically.get -> bool +Silk.NET.Windowing.ViewOptions.ShouldSwapAutomatically.set -> void +Silk.NET.Windowing.ViewOptions.UpdatesPerSecond.get -> double +Silk.NET.Windowing.ViewOptions.UpdatesPerSecond.set -> void +Silk.NET.Windowing.ViewOptions.VideoMode.get -> Silk.NET.Windowing.VideoMode +Silk.NET.Windowing.ViewOptions.VideoMode.set -> void +Silk.NET.Windowing.ViewOptions.ViewOptions() -> void +Silk.NET.Windowing.ViewOptions.ViewOptions(double framesPerSecond, double updatesPerSecond, Silk.NET.Windowing.GraphicsAPI api, bool isVSync, bool shouldSwapAutomatically, Silk.NET.Windowing.VideoMode videoMode, int? preferredDepthBufferBits = null, int? preferredStencilBufferBits = null, Silk.NET.Maths.Vector4D? preferredBitDepth = null, bool isEventDriven = false, int? samples = null, bool isContextControlDisabled = false) -> void +Silk.NET.Windowing.ViewOptions.ViewOptions(Silk.NET.Windowing.WindowOptions opts) -> void +Silk.NET.Windowing.ViewOptions.VSync.get -> bool +Silk.NET.Windowing.ViewOptions.VSync.set -> void +Silk.NET.Windowing.Window +Silk.NET.Windowing.WindowBorder +Silk.NET.Windowing.WindowBorder.Fixed = 1 -> Silk.NET.Windowing.WindowBorder +Silk.NET.Windowing.WindowBorder.Hidden = 2 -> Silk.NET.Windowing.WindowBorder +Silk.NET.Windowing.WindowBorder.Resizable = 0 -> Silk.NET.Windowing.WindowBorder +Silk.NET.Windowing.WindowExtensions +Silk.NET.Windowing.WindowOptions +Silk.NET.Windowing.WindowOptions.API.get -> Silk.NET.Windowing.GraphicsAPI +Silk.NET.Windowing.WindowOptions.API.set -> void +Silk.NET.Windowing.WindowOptions.FramesPerSecond.get -> double +Silk.NET.Windowing.WindowOptions.FramesPerSecond.set -> void +Silk.NET.Windowing.WindowOptions.IsContextControlDisabled.get -> bool +Silk.NET.Windowing.WindowOptions.IsContextControlDisabled.set -> void +Silk.NET.Windowing.WindowOptions.IsEventDriven.get -> bool +Silk.NET.Windowing.WindowOptions.IsEventDriven.set -> void +Silk.NET.Windowing.WindowOptions.IsVisible.get -> bool +Silk.NET.Windowing.WindowOptions.IsVisible.set -> void +Silk.NET.Windowing.WindowOptions.Position.get -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.WindowOptions.Position.set -> void +Silk.NET.Windowing.WindowOptions.PreferredBitDepth.get -> Silk.NET.Maths.Vector4D? +Silk.NET.Windowing.WindowOptions.PreferredBitDepth.set -> void +Silk.NET.Windowing.WindowOptions.PreferredDepthBufferBits.get -> int? +Silk.NET.Windowing.WindowOptions.PreferredDepthBufferBits.set -> void +Silk.NET.Windowing.WindowOptions.PreferredStencilBufferBits.get -> int? +Silk.NET.Windowing.WindowOptions.PreferredStencilBufferBits.set -> void +Silk.NET.Windowing.WindowOptions.Samples.get -> int? +Silk.NET.Windowing.WindowOptions.Samples.set -> void +Silk.NET.Windowing.WindowOptions.SharedContext.get -> Silk.NET.Core.Contexts.IGLContext? +Silk.NET.Windowing.WindowOptions.ShouldSwapAutomatically.get -> bool +Silk.NET.Windowing.WindowOptions.ShouldSwapAutomatically.set -> void +Silk.NET.Windowing.WindowOptions.Size.get -> Silk.NET.Maths.Vector2D +Silk.NET.Windowing.WindowOptions.Size.set -> void +Silk.NET.Windowing.WindowOptions.Title.get -> string! +Silk.NET.Windowing.WindowOptions.Title.set -> void +Silk.NET.Windowing.WindowOptions.TransparentFramebuffer.get -> bool +Silk.NET.Windowing.WindowOptions.TransparentFramebuffer.set -> void +Silk.NET.Windowing.WindowOptions.UpdatesPerSecond.get -> double +Silk.NET.Windowing.WindowOptions.UpdatesPerSecond.set -> void +Silk.NET.Windowing.WindowOptions.VideoMode.get -> Silk.NET.Windowing.VideoMode +Silk.NET.Windowing.WindowOptions.VideoMode.set -> void +Silk.NET.Windowing.WindowOptions.VSync.get -> bool +Silk.NET.Windowing.WindowOptions.VSync.set -> void +Silk.NET.Windowing.WindowOptions.WindowBorder.get -> Silk.NET.Windowing.WindowBorder +Silk.NET.Windowing.WindowOptions.WindowBorder.set -> void +Silk.NET.Windowing.WindowOptions.WindowClass.get -> string? +Silk.NET.Windowing.WindowOptions.WindowClass.set -> void +Silk.NET.Windowing.WindowOptions.WindowOptions() -> void +Silk.NET.Windowing.WindowOptions.WindowOptions(bool isVisible, Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Vector2D size, double framesPerSecond, double updatesPerSecond, Silk.NET.Windowing.GraphicsAPI api, string! title, Silk.NET.Windowing.WindowState windowState, Silk.NET.Windowing.WindowBorder windowBorder, bool isVSync, bool shouldSwapAutomatically, Silk.NET.Windowing.VideoMode videoMode, int? preferredDepthBufferBits = null, int? preferredStencilBufferBits = null, Silk.NET.Maths.Vector4D? preferredBitDepth = null, bool transparentFramebuffer = false, bool isEventDriven = false, Silk.NET.Core.Contexts.IGLContext? sharedContext = null, int? samples = null, string? windowClass = null, bool isContextControlDisabled = false) -> void +Silk.NET.Windowing.WindowOptions.WindowOptions(Silk.NET.Windowing.ViewOptions opts) -> void +Silk.NET.Windowing.WindowOptions.WindowState.get -> Silk.NET.Windowing.WindowState +Silk.NET.Windowing.WindowOptions.WindowState.set -> void +Silk.NET.Windowing.WindowPlatformAttribute +Silk.NET.Windowing.WindowPlatformAttribute.Type.get -> System.Type! +Silk.NET.Windowing.WindowPlatformAttribute.WindowPlatformAttribute(System.Type! type) -> void +Silk.NET.Windowing.WindowState +Silk.NET.Windowing.WindowState.Fullscreen = 3 -> Silk.NET.Windowing.WindowState +Silk.NET.Windowing.WindowState.Maximized = 2 -> Silk.NET.Windowing.WindowState +Silk.NET.Windowing.WindowState.Minimized = 1 -> Silk.NET.Windowing.WindowState +Silk.NET.Windowing.WindowState.Normal = 0 -> Silk.NET.Windowing.WindowState +static Silk.NET.Windowing.GraphicsAPI.Default.get -> Silk.NET.Windowing.GraphicsAPI +static Silk.NET.Windowing.GraphicsAPI.DefaultVulkan.get -> Silk.NET.Windowing.GraphicsAPI +static Silk.NET.Windowing.GraphicsAPI.None.get -> Silk.NET.Windowing.GraphicsAPI +static Silk.NET.Windowing.Monitor.GetMainMonitor(Silk.NET.Windowing.IView? view) -> Silk.NET.Windowing.IMonitor! +static Silk.NET.Windowing.Monitor.GetMonitors(Silk.NET.Windowing.IView? view) -> System.Collections.Generic.IEnumerable! +static Silk.NET.Windowing.VideoMode.Default.get -> Silk.NET.Windowing.VideoMode +static Silk.NET.Windowing.ViewOptions.Default.get -> Silk.NET.Windowing.ViewOptions +static Silk.NET.Windowing.ViewOptions.DefaultVulkan.get -> Silk.NET.Windowing.ViewOptions +static Silk.NET.Windowing.Window.Add(Silk.NET.Windowing.IWindowPlatform! platform) -> void +static Silk.NET.Windowing.Window.ClearCurrentContexts(Silk.NET.Windowing.IView! view) -> void +static Silk.NET.Windowing.Window.Create(Silk.NET.Windowing.WindowOptions options) -> Silk.NET.Windowing.IWindow! +static Silk.NET.Windowing.Window.GetOrDefault() -> T? +static Silk.NET.Windowing.Window.GetView(Silk.NET.Windowing.ViewOptions? options = null) -> Silk.NET.Windowing.IView! +static Silk.NET.Windowing.Window.GetWindowPlatform(bool viewOnly) -> Silk.NET.Windowing.IWindowPlatform? +static Silk.NET.Windowing.Window.IsViewOnly.get -> bool +static Silk.NET.Windowing.Window.Platforms.get -> System.Collections.Generic.IReadOnlyCollection! +static Silk.NET.Windowing.Window.Prioritize(Silk.NET.Windowing.IWindowPlatform! platform) -> void +static Silk.NET.Windowing.Window.PrioritizeGlfw() -> void +static Silk.NET.Windowing.Window.PrioritizeSdl() -> void +static Silk.NET.Windowing.Window.Remove(Silk.NET.Windowing.IWindowPlatform! platform) -> void +static Silk.NET.Windowing.Window.ShouldLoadFirstPartyPlatforms(bool shouldLoad) -> void +static Silk.NET.Windowing.Window.TryAdd(string! assemblyName) -> bool +static Silk.NET.Windowing.WindowExtensions.Center(this Silk.NET.Windowing.IWindow! window, Silk.NET.Windowing.IMonitor? monitor = null) -> void +static Silk.NET.Windowing.WindowExtensions.ClearContext(this Silk.NET.Windowing.IView! view) -> void +static Silk.NET.Windowing.WindowExtensions.GetFullSize(this Silk.NET.Windowing.IWindow! window) -> Silk.NET.Maths.Vector2D +static Silk.NET.Windowing.WindowExtensions.Invoke(this Silk.NET.Windowing.IView! view, System.Action! t) -> void +static Silk.NET.Windowing.WindowExtensions.Invoke(this Silk.NET.Windowing.IView! view, System.Func! t) -> T +static Silk.NET.Windowing.WindowExtensions.MakeCurrent(this Silk.NET.Windowing.IView! view) -> void +static Silk.NET.Windowing.WindowExtensions.Run(this Silk.NET.Windowing.IView! view) -> void +static Silk.NET.Windowing.WindowExtensions.SetDefaultIcon(this Silk.NET.Windowing.IWindow! window) -> void +static Silk.NET.Windowing.WindowExtensions.SetWindowIcon(this Silk.NET.Windowing.IWindow! window, ref Silk.NET.Core.RawImage icon) -> void +static Silk.NET.Windowing.WindowExtensions.SwapBuffers(this Silk.NET.Windowing.IView! view) -> void +static Silk.NET.Windowing.WindowOptions.Default.get -> Silk.NET.Windowing.WindowOptions +static Silk.NET.Windowing.WindowOptions.DefaultVulkan.get -> Silk.NET.Windowing.WindowOptions +Silk.NET.Windowing.WindowOptions.SharedContext.set -> void diff --git a/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Unshipped.txt b/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Unshipped.txt new file mode 100644 index 0000000000..1375c83df3 --- /dev/null +++ b/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Unshipped.txt @@ -0,0 +1,9 @@ +#nullable enable +Silk.NET.Windowing.IWindowPlatform.Name.get -> string! +Silk.NET.Windowing.IWindowProperties.TopMost.get -> bool +Silk.NET.Windowing.IWindowProperties.TopMost.set -> void +static Silk.NET.Windowing.Window.DefaultWindowClass.get -> string +Silk.NET.Windowing.VideoMode.AspectRatioEstimate.get -> Silk.NET.Maths.Vector2D? +Silk.NET.Windowing.WindowOptions.TopMost.get -> bool +Silk.NET.Windowing.WindowOptions.TopMost.set -> void +Silk.NET.Windowing.WindowOptions.WindowOptions(bool isVisible, Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Vector2D size, double framesPerSecond, double updatesPerSecond, Silk.NET.Windowing.GraphicsAPI api, string! title, Silk.NET.Windowing.WindowState windowState, Silk.NET.Windowing.WindowBorder windowBorder, bool isVSync, bool shouldSwapAutomatically, Silk.NET.Windowing.VideoMode videoMode, int? preferredDepthBufferBits = null, int? preferredStencilBufferBits = null, Silk.NET.Maths.Vector4D? preferredBitDepth = null, bool transparentFramebuffer = false, bool topMost = false, bool isEventDriven = false, Silk.NET.Core.Contexts.IGLContext? sharedContext = null, int? samples = null, string? windowClass = null, bool isContextControlDisabled = false) -> void From 595df3fad088a0c3d0f930bbfac0daee441721e7 Mon Sep 17 00:00:00 2001 From: Dylan Perks <11160611+Perksey@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:25:33 +0000 Subject: [PATCH 03/12] Improve (expound upon) the busy loop --- .../Internals/ViewImplementationBase.cs | 54 ++++++++++++++++--- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs index 7e0533b5c0..4abf0f6205 100644 --- a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs +++ b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs @@ -161,17 +161,40 @@ protected VideoMode CachedVideoMode set => _optionsCache.VideoMode = value; } +#ifdef NET7_0_OR_GREATER + private bool ShouldSpin + { + [MethodImpl(MethodImplOptions.NoInlining)] + get => !IsClosing && + !VSync && + _renderStopwatch.Elapsed.TotalSeconds < _renderPeriod && + _updateStopwatch.Elapsed.TotalSeconds < _updatePeriod && + !AnyInvokes(); } +#endif + // Game loop implementation public virtual void Run(Action onFrame) { -#ifdef NET7_0_OR_GREATER - if (System.Runtime.Intrinsics.X86Base.IsSupported) - { - System.Runtime.Intrinsics.X86Base.Pause(); - } -#endif while (!IsClosing) { +#ifdef NET7_0_OR_GREATER + if (System.Runtime.Intrinsics.X86.X86Base.IsSupported) + { + do + { + System.Runtime.Intrinsics.X86.X86Base.Pause(); + } + while (ShouldSpin); + } + if (System.Runtime.Intrinsics.Arm.ArmBase.IsSupported) + { + do + { + System.Runtime.Intrinsics.Arm.ArmBase.Yield(); + } + while (ShouldSpin); + } +#endif onFrame(); } } @@ -397,6 +420,25 @@ public void DoInvokes() } } +#ifdef NET7_0_OR_GREATER + private bool AnyInvokes() + { + for (var i = 0; i < _rented + completed && i < _pendingInvocations.Length; i++) + { + ref var invocation = ref _pendingInvocations[i]; + if (invocation.IsComplete || invocation.Delegate is null) + { + continue; + } + else + { + return true; + } + } + return false; + } +#endif + private void EnsureArrayIsReady(int rentalIndex) { _pendingInvocations ??= new PendingInvocation[InitialInvocationRental]; From 4fa5371b70343987539dc623dbf81b7c4b2f7006 Mon Sep 17 00:00:00 2001 From: Dylan Perks <11160611+Perksey@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:27:58 +0000 Subject: [PATCH 04/12] Weird code formatting --- .../Internals/ViewImplementationBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs index 4abf0f6205..dd3f63e3d3 100644 --- a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs +++ b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs @@ -169,7 +169,8 @@ private bool ShouldSpin !VSync && _renderStopwatch.Elapsed.TotalSeconds < _renderPeriod && _updateStopwatch.Elapsed.TotalSeconds < _updatePeriod && - !AnyInvokes(); } + !AnyInvokes(); + } #endif // Game loop implementation From 23e4b0423a9c39f93d308410b487776e95cce8ec Mon Sep 17 00:00:00 2001 From: Dylan Perks <11160611+Perksey@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:50:09 +0000 Subject: [PATCH 05/12] THIS IS NOT C++ --- .../Internals/ViewImplementationBase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs index dd3f63e3d3..48f61ca80d 100644 --- a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs +++ b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs @@ -161,7 +161,7 @@ protected VideoMode CachedVideoMode set => _optionsCache.VideoMode = value; } -#ifdef NET7_0_OR_GREATER +#if NET7_0_OR_GREATER private bool ShouldSpin { [MethodImpl(MethodImplOptions.NoInlining)] @@ -178,7 +178,7 @@ public virtual void Run(Action onFrame) { while (!IsClosing) { -#ifdef NET7_0_OR_GREATER +#if NET7_0_OR_GREATER if (System.Runtime.Intrinsics.X86.X86Base.IsSupported) { do @@ -421,7 +421,7 @@ public void DoInvokes() } } -#ifdef NET7_0_OR_GREATER +#if NET7_0_OR_GREATER private bool AnyInvokes() { for (var i = 0; i < _rented + completed && i < _pendingInvocations.Length; i++) From f4f1609647705a12c3ef15c71db5d7e2cbcff1f5 Mon Sep 17 00:00:00 2001 From: Dylan Perks <11160611+Perksey@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:42:54 +0000 Subject: [PATCH 06/12] Fix build --- .../Internals/ViewImplementationBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs index 48f61ca80d..5b62b9431b 100644 --- a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs +++ b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs @@ -424,12 +424,13 @@ public void DoInvokes() #if NET7_0_OR_GREATER private bool AnyInvokes() { + var completed = 0; for (var i = 0; i < _rented + completed && i < _pendingInvocations.Length; i++) { ref var invocation = ref _pendingInvocations[i]; if (invocation.IsComplete || invocation.Delegate is null) { - continue; + completed++; } else { From 419bf86e82a86a3601ac42ca53b1d47717b66cd3 Mon Sep 17 00:00:00 2001 From: Dylan Perks Date: Sun, 6 Aug 2023 22:31:52 +0100 Subject: [PATCH 07/12] Attempt to add BreakneckSleep --- Silk.NET.sln | 15 ++ .../Miscellaneous/BreakneckSleep.cs | 209 ++++++++++++++++++ src/Core/Silk.NET.Core/Silk.NET.Core.csproj | 2 +- src/Lab/Experiments/TimeTrials/Program.cs | 16 ++ .../Experiments/TimeTrials/TimeTrials.csproj | 14 ++ 5 files changed, 255 insertions(+), 1 deletion(-) create mode 100644 src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs create mode 100644 src/Lab/Experiments/TimeTrials/Program.cs create mode 100644 src/Lab/Experiments/TimeTrials/TimeTrials.csproj diff --git a/Silk.NET.sln b/Silk.NET.sln index 2afc3f6ef2..7ded3d5261 100644 --- a/Silk.NET.sln +++ b/Silk.NET.sln @@ -594,6 +594,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Shaderc", "src\SPI EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Shaderc.Native", "src\Native\Silk.NET.Shaderc.Native\Silk.NET.Shaderc.Native.csproj", "{D1E4EDC7-0A06-498A-B0F9-275B7D508A0E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TimeTrials", "src\Lab\Experiments\TimeTrials\TimeTrials.csproj", "{021EE492-FB0E-46CF-AC07-768D5A999798}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -3615,6 +3617,18 @@ Global {D1E4EDC7-0A06-498A-B0F9-275B7D508A0E}.Release|x64.Build.0 = Release|Any CPU {D1E4EDC7-0A06-498A-B0F9-275B7D508A0E}.Release|x86.ActiveCfg = Release|Any CPU {D1E4EDC7-0A06-498A-B0F9-275B7D508A0E}.Release|x86.Build.0 = Release|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Debug|Any CPU.Build.0 = Debug|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Debug|x64.ActiveCfg = Debug|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Debug|x64.Build.0 = Debug|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Debug|x86.ActiveCfg = Debug|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Debug|x86.Build.0 = Debug|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Release|Any CPU.ActiveCfg = Release|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Release|Any CPU.Build.0 = Release|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Release|x64.ActiveCfg = Release|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Release|x64.Build.0 = Release|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Release|x86.ActiveCfg = Release|Any CPU + {021EE492-FB0E-46CF-AC07-768D5A999798}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3904,6 +3918,7 @@ Global {1E7C6166-58B2-46B3-A9BA-18099BD83AF0} = {20A4A2D1-D699-4D71-AA97-950154638576} {E77BE8DB-3C74-42EB-9B65-67EAAA9AD7DB} = {15FC3D1A-25D7-446B-87A7-B45BA3C2225F} {D1E4EDC7-0A06-498A-B0F9-275B7D508A0E} = {72E7FA64-5B1E-477D-BD30-63B7F206B3C4} + {021EE492-FB0E-46CF-AC07-768D5A999798} = {39B598E9-44BA-4A61-A1BB-7C543734DBA6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D} diff --git a/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs b/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs new file mode 100644 index 0000000000..1b428c922d --- /dev/null +++ b/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs @@ -0,0 +1,209 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#if NET7_0_OR_GREATER +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Runtime.Intrinsics.Arm; +using System.Runtime.Intrinsics.X86; +using Silk.NET.Core.Native; + +namespace Silk.NET.Core; + +/// +/// Implementation of a high-resolution clock intended for short-duration sleeps. +/// +public readonly struct BreakneckSleep : IDisposable +{ + /// + /// Determines how accurate a implementation is. + /// + public enum AccuracyMode + { + /// + /// The underlying implementation can be trusted to be fully accurate. + /// + HighestResolution, + + /// + /// The underlying implementation is mostly accurate, but uses a busy loop for the 10% to account for potential + /// inaccuracies. + /// + HighResolutionWithBusyLoop, + + /// + /// There is no high-resolution implementation available thus a busy loop is used. + /// + BusyLoopOnly + } + + /// + /// The underlying handle of the timer, if any. + /// + public nint Handle { get; } + + /// + /// The duration of the sleep. + /// + public TimeSpan Duration { get; } + + /// + /// The accuracy of the underlying implementation. + /// + public AccuracyMode Accuracy { get; } + + /// + /// Creates a high-resolution timer + /// + /// + public BreakneckSleep(TimeSpan duration) + { + Duration = duration; + Accuracy = AccuracyMode.BusyLoopOnly; + if (OperatingSystem.IsWindows()) + { + var (handle, isHigh) = WindowsCreate(); + Handle = handle; + Accuracy = isHigh ? AccuracyMode.HighestResolution : AccuracyMode.HighResolutionWithBusyLoop; + return; + } + + Handle = 0; + if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || OperatingSystem.IsIOS() || + OperatingSystem.IsTvOS() || OperatingSystem.IsWatchOS() || OperatingSystem.IsMacCatalyst()) + { + Accuracy = AccuracyMode.HighResolutionWithBusyLoop; + } + } + + /// + /// Sleeps for . + /// + public void Sleep() + { + var start = Stopwatch.GetTimestamp(); + var emergencySpin = false; + if (OperatingSystem.IsWindows()) + { + emergencySpin = !WindowsWait(); + } + + if (OperatingSystem.IsLinux()) + { + LinuxWait(); + } + + if (OperatingSystem.IsMacOS() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || + OperatingSystem.IsWatchOS() || OperatingSystem.IsMacCatalyst()) + { + AppleWait(); + } + + if (Accuracy is AccuracyMode.HighResolutionWithBusyLoop or AccuracyMode.BusyLoopOnly || emergencySpin) + { + do + { + if (X86Base.IsSupported) + { + X86Base.Pause(); + } + + if (ArmBase.IsSupported) + { + ArmBase.Yield(); + } + } while (Stopwatch.GetElapsedTime(start, Stopwatch.GetTimestamp()) < Duration); + } + } + + private static unsafe (nint Handle, bool IsHighResolution) WindowsCreate() + { + const uint createWaitableTimerManualReset = 0x00000001; + const uint createWaitableTimerHighResolution = 0x00000002; + const uint timerAllAccess = 0x1F0003; + [DllImport("kernel32.dll", ExactSpelling = true)] + static extern nint CreateWaitableTimerExW + ( + SecurityAttributes* lpTimerAttributes, + char* lpTimerName, + uint dwFlags, + uint dwDesiredAccess + ); + + var ret = CreateWaitableTimerExW + (null, null, createWaitableTimerManualReset | createWaitableTimerHighResolution, timerAllAccess); + return ret != 0 + ? (ret, true) + : (CreateWaitableTimerExW(null, null, createWaitableTimerManualReset, timerAllAccess), false); + } + + private unsafe bool WindowsWait() + { + [DllImport("kernel32.dll", ExactSpelling = true)] + static extern uint SetWaitableTimerEx + ( + nint hTimer, + FILETIME* lpDueTime, + long lPeriod, + void* pfnCompletionRoutine, + void* lpArgToCompletionRoutine, + void* wakeContext, + ulong tolerableDelay + ); + + static FILETIME CreateFileTime(TimeSpan ts) + { + var ul = unchecked((ulong) -ts.Ticks); + return new FILETIME + { + dwHighDateTime = (int) (ul >> 32), + dwLowDateTime = (int) (ul & 0xFFFFFFFF) + }; + } + + var ft = CreateFileTime + ( + Accuracy == AccuracyMode.HighestResolution + ? Duration + : TimeSpan.FromMicroseconds(Duration.TotalMicroseconds * 0.9) + ); + if (SetWaitableTimerEx(Handle, &ft, 0, null, null, null, 0) == 1) + { + SilkMarshal.WaitWindowsObjects(Handle); + return true; + } + + return false; + } + + private unsafe void LinuxWait() + { + [DllImport("libc", EntryPoint = "nanosleep")] + static extern int Nanosleep(Timespec* req, Timespec* rem); + + var ts = new Timespec + { + Seconds = Duration.Seconds, + Nanoseconds = Duration.Nanoseconds - Duration.Seconds * 1000000000 + }; + _ = Nanosleep(&ts, null); + } + + private void AppleWait() + { + [DllImport("libc", EntryPoint = "usleep")] + static extern int Usleep(uint micros); + _ = Usleep((uint) (Duration.TotalMicroseconds * 0.9)); + } + + public void Dispose() + { + if (OperatingSystem.IsWindows()) + { + SilkMarshal.ThrowHResult(SilkMarshal.CloseWindowsHandle(Handle)); + } + } +} +#endif diff --git a/src/Core/Silk.NET.Core/Silk.NET.Core.csproj b/src/Core/Silk.NET.Core/Silk.NET.Core.csproj index ae5a8b1fcc..76db24e0f8 100644 --- a/src/Core/Silk.NET.Core/Silk.NET.Core.csproj +++ b/src/Core/Silk.NET.Core/Silk.NET.Core.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0 + netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net7.0 true preview true diff --git a/src/Lab/Experiments/TimeTrials/Program.cs b/src/Lab/Experiments/TimeTrials/Program.cs new file mode 100644 index 0000000000..429f76513b --- /dev/null +++ b/src/Lab/Experiments/TimeTrials/Program.cs @@ -0,0 +1,16 @@ +// See https://aka.ms/new-console-template for more information + +using System.Diagnostics; +using Silk.NET.Core; + +for (var fps = 60; fps < 61440; fps *= 2) +{ + var sleep = new BreakneckSleep(TimeSpan.FromSeconds(1 / (double)fps)); + for (var t = 0; t < 5; t++) + { + var now = Stopwatch.GetTimestamp(); + sleep.Sleep(); + Console.WriteLine + ($"{fps} FPS = {1 / Stopwatch.GetElapsedTime(now, Stopwatch.GetTimestamp()).TotalSeconds} FPS"); + } +} diff --git a/src/Lab/Experiments/TimeTrials/TimeTrials.csproj b/src/Lab/Experiments/TimeTrials/TimeTrials.csproj new file mode 100644 index 0000000000..ec90dd524f --- /dev/null +++ b/src/Lab/Experiments/TimeTrials/TimeTrials.csproj @@ -0,0 +1,14 @@ + + + + Exe + net7.0 + enable + enable + + + + + + + From 8b21c93a540df36aedf1c3b977e05a41952b43f8 Mon Sep 17 00:00:00 2001 From: Lilly Sieberer Date: Fri, 18 Aug 2023 18:12:15 -0400 Subject: [PATCH 08/12] Proper frame timing in BreakneckSleep (#1610) * Proper frame timing in BreakneckSleep Should _lastTick be a property or left as a field? unsure * adjusted to feedback * forgot to make the example work too --- .../Miscellaneous/BreakneckSleep.cs | 37 ++++++++----------- src/Lab/Experiments/TimeTrials/Program.cs | 4 +- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs b/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs index 1b428c922d..6e1d480e71 100644 --- a/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs +++ b/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs @@ -44,11 +44,6 @@ public enum AccuracyMode /// public nint Handle { get; } - /// - /// The duration of the sleep. - /// - public TimeSpan Duration { get; } - /// /// The accuracy of the underlying implementation. /// @@ -57,10 +52,8 @@ public enum AccuracyMode /// /// Creates a high-resolution timer /// - /// - public BreakneckSleep(TimeSpan duration) + public BreakneckSleep() { - Duration = duration; Accuracy = AccuracyMode.BusyLoopOnly; if (OperatingSystem.IsWindows()) { @@ -79,26 +72,26 @@ public BreakneckSleep(TimeSpan duration) } /// - /// Sleeps for . + /// Sleeps for . /// - public void Sleep() + public void Sleep(TimeSpan duration) { var start = Stopwatch.GetTimestamp(); var emergencySpin = false; if (OperatingSystem.IsWindows()) { - emergencySpin = !WindowsWait(); + emergencySpin = !WindowsWait(duration); } if (OperatingSystem.IsLinux()) { - LinuxWait(); + LinuxWait(duration); } if (OperatingSystem.IsMacOS() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || OperatingSystem.IsWatchOS() || OperatingSystem.IsMacCatalyst()) { - AppleWait(); + AppleWait(duration); } if (Accuracy is AccuracyMode.HighResolutionWithBusyLoop or AccuracyMode.BusyLoopOnly || emergencySpin) @@ -114,7 +107,7 @@ public void Sleep() { ArmBase.Yield(); } - } while (Stopwatch.GetElapsedTime(start, Stopwatch.GetTimestamp()) < Duration); + } while (Stopwatch.GetElapsedTime(start, Stopwatch.GetTimestamp()) < duration); } } @@ -139,7 +132,7 @@ uint dwDesiredAccess : (CreateWaitableTimerExW(null, null, createWaitableTimerManualReset, timerAllAccess), false); } - private unsafe bool WindowsWait() + private unsafe bool WindowsWait(TimeSpan duration) { [DllImport("kernel32.dll", ExactSpelling = true)] static extern uint SetWaitableTimerEx @@ -166,8 +159,8 @@ static FILETIME CreateFileTime(TimeSpan ts) var ft = CreateFileTime ( Accuracy == AccuracyMode.HighestResolution - ? Duration - : TimeSpan.FromMicroseconds(Duration.TotalMicroseconds * 0.9) + ? duration + : TimeSpan.FromMicroseconds(duration.TotalMicroseconds * 0.9) ); if (SetWaitableTimerEx(Handle, &ft, 0, null, null, null, 0) == 1) { @@ -178,24 +171,24 @@ static FILETIME CreateFileTime(TimeSpan ts) return false; } - private unsafe void LinuxWait() + private unsafe void LinuxWait(TimeSpan duration) { [DllImport("libc", EntryPoint = "nanosleep")] static extern int Nanosleep(Timespec* req, Timespec* rem); var ts = new Timespec { - Seconds = Duration.Seconds, - Nanoseconds = Duration.Nanoseconds - Duration.Seconds * 1000000000 + Seconds = duration.Seconds, + Nanoseconds = duration.Nanoseconds - duration.Seconds * 1000000000 }; _ = Nanosleep(&ts, null); } - private void AppleWait() + private void AppleWait(TimeSpan duration) { [DllImport("libc", EntryPoint = "usleep")] static extern int Usleep(uint micros); - _ = Usleep((uint) (Duration.TotalMicroseconds * 0.9)); + _ = Usleep((uint) (duration.TotalMicroseconds * 0.9)); } public void Dispose() diff --git a/src/Lab/Experiments/TimeTrials/Program.cs b/src/Lab/Experiments/TimeTrials/Program.cs index 429f76513b..36c7519d15 100644 --- a/src/Lab/Experiments/TimeTrials/Program.cs +++ b/src/Lab/Experiments/TimeTrials/Program.cs @@ -5,11 +5,11 @@ for (var fps = 60; fps < 61440; fps *= 2) { - var sleep = new BreakneckSleep(TimeSpan.FromSeconds(1 / (double)fps)); + var sleep = new BreakneckSleep(); for (var t = 0; t < 5; t++) { var now = Stopwatch.GetTimestamp(); - sleep.Sleep(); + sleep.Sleep(TimeSpan.FromSeconds(1 / (double)fps)); Console.WriteLine ($"{fps} FPS = {1 / Stopwatch.GetElapsedTime(now, Stopwatch.GetTimestamp()).TotalSeconds} FPS"); } From 1a7a5c7055a8ffbafe3eef2836e02231079cbf1e Mon Sep 17 00:00:00 2001 From: Dylan Perks Date: Fri, 18 Aug 2023 18:48:51 -0500 Subject: [PATCH 09/12] Start work on TimeWindow type --- .../Miscellaneous/BreakneckSleep.cs | 73 ++++++---- .../Silk.NET.Core/Miscellaneous/TimeWindow.cs | 129 ++++++++++++++++++ src/Lab/Experiments/TimeTrials/Program.cs | 45 +++++- 3 files changed, 213 insertions(+), 34 deletions(-) create mode 100644 src/Core/Silk.NET.Core/Miscellaneous/TimeWindow.cs diff --git a/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs b/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs index 6e1d480e71..3c743f1fce 100644 --- a/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs +++ b/src/Core/Silk.NET.Core/Miscellaneous/BreakneckSleep.cs @@ -4,6 +4,7 @@ #if NET7_0_OR_GREATER using System; using System.Diagnostics; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Runtime.Intrinsics.Arm; @@ -39,6 +40,22 @@ public enum AccuracyMode BusyLoopOnly } + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + private static double TrustFactor(AccuracyMode mode) => mode switch + { + AccuracyMode.HighestResolution => 0.9, + _ => 0.75 + }; + + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + private static bool ShouldTrust(double fps, AccuracyMode mode) => (fps, mode) switch + { + (>= 200, AccuracyMode.HighestResolution) => false, + (>= 100, AccuracyMode.HighResolutionWithBusyLoop) => false, + (>= 50, _) => false, + _ => true + }; + /// /// The underlying handle of the timer, if any. /// @@ -74,41 +91,41 @@ public BreakneckSleep() /// /// Sleeps for . /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Sleep(TimeSpan duration) { var start = Stopwatch.GetTimestamp(); - var emergencySpin = false; - if (OperatingSystem.IsWindows()) + if (ShouldTrust(1 / duration.TotalSeconds, Accuracy)) { - emergencySpin = !WindowsWait(duration); - } + if (OperatingSystem.IsWindows()) + { + WindowsWait(duration); + } - if (OperatingSystem.IsLinux()) - { - LinuxWait(duration); - } + if (OperatingSystem.IsLinux()) + { + LinuxWait(duration); + } - if (OperatingSystem.IsMacOS() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || - OperatingSystem.IsWatchOS() || OperatingSystem.IsMacCatalyst()) - { - AppleWait(duration); + if (OperatingSystem.IsMacOS() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || + OperatingSystem.IsWatchOS() || OperatingSystem.IsMacCatalyst()) + { + AppleWait(duration); + } } - if (Accuracy is AccuracyMode.HighResolutionWithBusyLoop or AccuracyMode.BusyLoopOnly || emergencySpin) + do { - do + if (X86Base.IsSupported) { - if (X86Base.IsSupported) - { - X86Base.Pause(); - } - - if (ArmBase.IsSupported) - { - ArmBase.Yield(); - } - } while (Stopwatch.GetElapsedTime(start, Stopwatch.GetTimestamp()) < duration); - } + X86Base.Pause(); + } + + if (ArmBase.IsSupported) + { + ArmBase.Yield(); + } + } while (Stopwatch.GetElapsedTime(start, Stopwatch.GetTimestamp()) < duration); } private static unsafe (nint Handle, bool IsHighResolution) WindowsCreate() @@ -160,7 +177,7 @@ static FILETIME CreateFileTime(TimeSpan ts) ( Accuracy == AccuracyMode.HighestResolution ? duration - : TimeSpan.FromMicroseconds(duration.TotalMicroseconds * 0.9) + : TimeSpan.FromMicroseconds(duration.TotalMicroseconds * TrustFactor(Accuracy)) ); if (SetWaitableTimerEx(Handle, &ft, 0, null, null, null, 0) == 1) { @@ -173,6 +190,8 @@ static FILETIME CreateFileTime(TimeSpan ts) private unsafe void LinuxWait(TimeSpan duration) { + duration *= TrustFactor(AccuracyMode.HighResolutionWithBusyLoop); + [DllImport("libc", EntryPoint = "nanosleep")] static extern int Nanosleep(Timespec* req, Timespec* rem); @@ -188,7 +207,7 @@ private void AppleWait(TimeSpan duration) { [DllImport("libc", EntryPoint = "usleep")] static extern int Usleep(uint micros); - _ = Usleep((uint) (duration.TotalMicroseconds * 0.9)); + _ = Usleep((uint) (duration.TotalMicroseconds * TrustFactor(AccuracyMode.HighResolutionWithBusyLoop))); } public void Dispose() diff --git a/src/Core/Silk.NET.Core/Miscellaneous/TimeWindow.cs b/src/Core/Silk.NET.Core/Miscellaneous/TimeWindow.cs new file mode 100644 index 0000000000..d30e8ef7de --- /dev/null +++ b/src/Core/Silk.NET.Core/Miscellaneous/TimeWindow.cs @@ -0,0 +1,129 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; + +namespace Silk.NET.Core; + +/// +/// Represents a window/interval of time in which the caller can execute. +/// +/// +/// To create a 60 FPS loop: +/// +/// var window = new TimeWindow(); +/// window.Window = TimeSpan.FromSeconds(1.0 / 60.0); +/// while (true) +/// { +/// if (window.BeginWindow()) +/// { +/// // It's time for the next piece of work (e.g. rendering the next frame) +/// window.EndWindow(); // don't forget this! +/// } +/// // Anything that isn't necessarily dependent on a time window goes here. +/// // In most cases, BeginWindow will sleep and always return true. This is not guaranteed, however, so anything +/// // "real-time" (e.g. event processing) should be done here. +/// } +/// +/// +public class TimeWindow +{ +#if NET7_0_OR_GREATER + private readonly BreakneckSleep _sleep = new(); +#endif + private readonly Stopwatch _sw = Stopwatch.StartNew(); + /// + /// Creates a . + /// + /// + /// Whether should sleep until the next window is due to start. + /// + // ReSharper disable once UnusedParameter.Local + public TimeWindow(bool sleeping = true) + { +#if NET7_0_OR_GREATER + Sleeping = sleeping; +#endif + } + + /// + /// The duration of a single window. For example, if you wanted to render 60 frames per second, a single frame shall + /// be thought of as being rendered in a 1.0 / 60.0 second window. + /// + public TimeSpan Window { get; set; } = TimeSpan.FromSeconds(1.0 / 60.0); + + /// + /// The offset from the point at which this was constructed (or the last time + /// was called) at which the next window is due to begin. + /// + public TimeSpan NextWindowStart { get; private set; } = TimeSpan.Zero; + + /// + /// The offset from the point at which this was constructed (or the last time + /// was called) at which the next window is due to begin. + /// + public TimeSpan NextWindowEnd + { + [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)768)] + get => NextWindowStart + Window; + } + + /// + /// The offset from the point at which this was constructed (or the last time + /// was called). + /// + public TimeSpan CurrentTime + { + [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)768)] + get => _sw.Elapsed; + } + +#if NET7_0_OR_GREATER + /// + /// Whether should use . + /// + private bool Sleeping { get; } +#endif + + /// + /// Resets the to zero and the offset from which is + /// measured. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)768)] + public void Reset() + { + _sw.Restart(); + NextWindowStart = TimeSpan.Zero; + } + + /// + /// Determines whether the next window is due. + /// + /// True if the next window is due or overdue, false otherwise. + /// + /// If false, do any time-independent, real-time work and call this method again. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)768)] + public bool BeginWindow() + { +#if NET7_0_OR_GREATER + var ct = CurrentTime; + if (Sleeping && ct < NextWindowStart) + { + _sleep.Sleep(NextWindowStart - ct); + } +#endif + return CurrentTime >= NextWindowStart; + } + + /// + /// Completes this time window. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)768)] + public void EndWindow() + { + NextWindowStart += Window; + } +} diff --git a/src/Lab/Experiments/TimeTrials/Program.cs b/src/Lab/Experiments/TimeTrials/Program.cs index 36c7519d15..5ba9e83dda 100644 --- a/src/Lab/Experiments/TimeTrials/Program.cs +++ b/src/Lab/Experiments/TimeTrials/Program.cs @@ -1,16 +1,47 @@ // See https://aka.ms/new-console-template for more information +using System.Collections.Concurrent; using System.Diagnostics; using Silk.NET.Core; -for (var fps = 60; fps < 61440; fps *= 2) +var timeWindow = new TimeWindow(); +var bag = new ConcurrentBag(); +var sw = new Stopwatch(); +Console.Write("Enter frames per second: "); +timeWindow.Window = TimeSpan.FromSeconds(1 / double.Parse(Console.ReadLine()!)); +Console.WriteLine("Press Ctrl+C to measure statistics."); +Console.CancelKeyPress += (_, _) => { - var sleep = new BreakneckSleep(); - for (var t = 0; t < 5; t++) + var overshoots = bag.ToList(); + var count = overshoots.Count; + sw.Stop(); + Console.WriteLine($"Run time: {sw.Elapsed.TotalSeconds}"); + Console.WriteLine($"Frames: {overshoots.Count}"); + Console.WriteLine($"Expected Frames: {sw.Elapsed.TotalSeconds / timeWindow.Window.TotalSeconds}"); + Console.WriteLine($"Overshoots: {overshoots.Count(x => x > 0)}"); + Console.WriteLine($"Undershoots: {overshoots.Count(x => x < 0)}"); + Console.WriteLine($"Max overshoot: {overshoots.Max()}"); + Console.WriteLine($"Max undershoot: {overshoots.Min()}"); + Console.WriteLine($"Mean overshoot/undershoot: {overshoots.Sum() / overshoots.Count}"); + Console.WriteLine($"Median overshoot/undershoot: {overshoots.Order().ElementAt(overshoots.Count / 2)}"); + Console.WriteLine($"Overshoot/undershoot range: {overshoots.Max() - overshoots.Min()}"); + overshoots.RemoveAll(x => x < 0); + Console.WriteLine($"Min overshoot/wasted time per frame: {overshoots.Min()}"); + Console.WriteLine($"Mean wasted time per frame: {overshoots.Sum() / overshoots.Count}"); + Console.WriteLine($"Median wasted time per frame: {overshoots.Order().ElementAt(overshoots.Count / 2)}"); + Console.WriteLine($"Range for wasted time per frame: {overshoots.Max() - overshoots.Min()}"); + Console.WriteLine($"Final FPS: {1 / (sw.Elapsed.TotalSeconds / count)}"); +}; +sw.Start(); +while (true) +{ + if (timeWindow.BeginWindow()) + { + bag.Add((timeWindow.CurrentTime - timeWindow.NextWindowStart).TotalSeconds); + timeWindow.EndWindow(); + } + else { - var now = Stopwatch.GetTimestamp(); - sleep.Sleep(TimeSpan.FromSeconds(1 / (double)fps)); - Console.WriteLine - ($"{fps} FPS = {1 / Stopwatch.GetElapsedTime(now, Stopwatch.GetTimestamp()).TotalSeconds} FPS"); + bag.Add(-(timeWindow.NextWindowStart - timeWindow.CurrentTime).TotalSeconds); } } From 3e222b056a5afa2301b488dc5062528e15fc5dab Mon Sep 17 00:00:00 2001 From: Dylan Perks Date: Sun, 20 Aug 2023 12:54:49 -0500 Subject: [PATCH 10/12] Add integration with windowing to TimeTirals --- .../Silk.NET.Core/Miscellaneous/TimeWindow.cs | 6 +- src/Lab/Experiments/TimeTrials/Program.cs | 58 ++++++++++++++++++- .../Experiments/TimeTrials/TimeTrials.csproj | 1 + 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/src/Core/Silk.NET.Core/Miscellaneous/TimeWindow.cs b/src/Core/Silk.NET.Core/Miscellaneous/TimeWindow.cs index d30e8ef7de..1ad4056baf 100644 --- a/src/Core/Silk.NET.Core/Miscellaneous/TimeWindow.cs +++ b/src/Core/Silk.NET.Core/Miscellaneous/TimeWindow.cs @@ -110,11 +110,13 @@ public bool BeginWindow() { #if NET7_0_OR_GREATER var ct = CurrentTime; - if (Sleeping && ct < NextWindowStart) + var nw = NextWindowStart; + if (Sleeping && ct < nw) { - _sleep.Sleep(NextWindowStart - ct); + _sleep.Sleep(nw - ct); } #endif + // ct local var intentionally not used here to ensure we are up-to-date return CurrentTime >= NextWindowStart; } diff --git a/src/Lab/Experiments/TimeTrials/Program.cs b/src/Lab/Experiments/TimeTrials/Program.cs index 5ba9e83dda..1514c9ea9a 100644 --- a/src/Lab/Experiments/TimeTrials/Program.cs +++ b/src/Lab/Experiments/TimeTrials/Program.cs @@ -3,12 +3,68 @@ using System.Collections.Concurrent; using System.Diagnostics; using Silk.NET.Core; +using Silk.NET.Windowing; -var timeWindow = new TimeWindow(); +var timeWindow = new TimeWindow(false); var bag = new ConcurrentBag(); var sw = new Stopwatch(); Console.Write("Enter frames per second: "); timeWindow.Window = TimeSpan.FromSeconds(1 / double.Parse(Console.ReadLine()!)); +Console.Write("Open a window? (Y/N) "); +ConsoleKey k; +while ((k = Console.ReadKey().Key) is not ConsoleKey.Y and not ConsoleKey.Y) {} + +if (k == ConsoleKey.Y) +{ + Console.Write("\nOpening window...\n"); + var realWindow = Window.Create + ( + WindowOptions.Default with + { + VSync = false, FramesPerSecond = 1 / timeWindow.Window.TotalSeconds, + UpdatesPerSecond = 1 / timeWindow.Window.TotalSeconds + } + ); + realWindow.Initialize(); + realWindow.Title += " | 0 FPS | 0 UPS"; + realWindow.Render += d => + { + var cur = realWindow.Title; + realWindow.Title = cur.Replace + (cur[cur.IndexOf('|')..(cur.IndexOf(" FPS", StringComparison.Ordinal) + 4)], $"| {1 / d:0000.000} FPS"); + Console.WriteLine($"{sw.Elapsed.TotalSeconds},{d}"); + }; + realWindow.Update += d => + { + var cur = realWindow.Title; + realWindow.Title = cur.Replace + (cur[cur.LastIndexOf('|')..(cur.IndexOf(" UPS", StringComparison.Ordinal) + 4)], $"| {1 / d:0000.000} UPS"); + }; + Console.WriteLine("Recording Time,Frame Time"); + sw.Start(); + while (!realWindow.IsClosing) + { + if (timeWindow.BeginWindow()) + { + if (!realWindow.IsClosing) + { + realWindow.DoUpdate(); + } + + if (!realWindow.IsClosing) + { + realWindow.DoRender(); + } + timeWindow.EndWindow(); + } + realWindow.DoEvents(); + } + + realWindow.DoEvents(); + realWindow.Reset(); + return; +} + Console.WriteLine("Press Ctrl+C to measure statistics."); Console.CancelKeyPress += (_, _) => { diff --git a/src/Lab/Experiments/TimeTrials/TimeTrials.csproj b/src/Lab/Experiments/TimeTrials/TimeTrials.csproj index ec90dd524f..f4d5d74797 100644 --- a/src/Lab/Experiments/TimeTrials/TimeTrials.csproj +++ b/src/Lab/Experiments/TimeTrials/TimeTrials.csproj @@ -9,6 +9,7 @@ + From 1bf2b424a2e3adebe8c7cc494eaaceb1c038ca92 Mon Sep 17 00:00:00 2001 From: Dylan Perks Date: Sun, 20 Aug 2023 12:59:42 -0500 Subject: [PATCH 11/12] revert changes to windowing --- .../Internals/ViewImplementationBase.cs | 50 ---- .../PublicAPI/net7.0/PublicAPI.Shipped.txt | 250 ------------------ .../PublicAPI/net7.0/PublicAPI.Unshipped.txt | 9 - .../Silk.NET.Windowing.Common.csproj | 2 +- 4 files changed, 1 insertion(+), 310 deletions(-) delete mode 100644 src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Shipped.txt delete mode 100644 src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Unshipped.txt diff --git a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs index 5b62b9431b..580a587d8f 100644 --- a/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs +++ b/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs @@ -161,41 +161,11 @@ protected VideoMode CachedVideoMode set => _optionsCache.VideoMode = value; } -#if NET7_0_OR_GREATER - private bool ShouldSpin - { - [MethodImpl(MethodImplOptions.NoInlining)] - get => !IsClosing && - !VSync && - _renderStopwatch.Elapsed.TotalSeconds < _renderPeriod && - _updateStopwatch.Elapsed.TotalSeconds < _updatePeriod && - !AnyInvokes(); - } -#endif - // Game loop implementation public virtual void Run(Action onFrame) { while (!IsClosing) { -#if NET7_0_OR_GREATER - if (System.Runtime.Intrinsics.X86.X86Base.IsSupported) - { - do - { - System.Runtime.Intrinsics.X86.X86Base.Pause(); - } - while (ShouldSpin); - } - if (System.Runtime.Intrinsics.Arm.ArmBase.IsSupported) - { - do - { - System.Runtime.Intrinsics.Arm.ArmBase.Yield(); - } - while (ShouldSpin); - } -#endif onFrame(); } } @@ -421,26 +391,6 @@ public void DoInvokes() } } -#if NET7_0_OR_GREATER - private bool AnyInvokes() - { - var completed = 0; - for (var i = 0; i < _rented + completed && i < _pendingInvocations.Length; i++) - { - ref var invocation = ref _pendingInvocations[i]; - if (invocation.IsComplete || invocation.Delegate is null) - { - completed++; - } - else - { - return true; - } - } - return false; - } -#endif - private void EnsureArrayIsReady(int rentalIndex) { _pendingInvocations ??= new PendingInvocation[InitialInvocationRental]; diff --git a/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Shipped.txt b/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Shipped.txt deleted file mode 100644 index 257c914b4b..0000000000 --- a/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Shipped.txt +++ /dev/null @@ -1,250 +0,0 @@ -#nullable enable -Silk.NET.Windowing.APIVersion -Silk.NET.Windowing.APIVersion.APIVersion() -> void -Silk.NET.Windowing.APIVersion.APIVersion(int majorVersion, int minorVersion) -> void -Silk.NET.Windowing.APIVersion.APIVersion(System.Version! version) -> void -Silk.NET.Windowing.APIVersion.MajorVersion -> int -Silk.NET.Windowing.APIVersion.MinorVersion -> int -Silk.NET.Windowing.ContextAPI -Silk.NET.Windowing.ContextAPI.None = 0 -> Silk.NET.Windowing.ContextAPI -Silk.NET.Windowing.ContextAPI.OpenGL = 2 -> Silk.NET.Windowing.ContextAPI -Silk.NET.Windowing.ContextAPI.OpenGLES = 3 -> Silk.NET.Windowing.ContextAPI -Silk.NET.Windowing.ContextAPI.Vulkan = 1 -> Silk.NET.Windowing.ContextAPI -Silk.NET.Windowing.ContextFlags -Silk.NET.Windowing.ContextFlags.Debug = 1 -> Silk.NET.Windowing.ContextFlags -Silk.NET.Windowing.ContextFlags.Default = 0 -> Silk.NET.Windowing.ContextFlags -Silk.NET.Windowing.ContextFlags.ForwardCompatible = 2 -> Silk.NET.Windowing.ContextFlags -Silk.NET.Windowing.ContextProfile -Silk.NET.Windowing.ContextProfile.Compatability = 1 -> Silk.NET.Windowing.ContextProfile -Silk.NET.Windowing.ContextProfile.Core = 0 -> Silk.NET.Windowing.ContextProfile -Silk.NET.Windowing.GraphicsAPI -Silk.NET.Windowing.GraphicsAPI.API.get -> Silk.NET.Windowing.ContextAPI -Silk.NET.Windowing.GraphicsAPI.API.set -> void -Silk.NET.Windowing.GraphicsAPI.Flags.get -> Silk.NET.Windowing.ContextFlags -Silk.NET.Windowing.GraphicsAPI.Flags.set -> void -Silk.NET.Windowing.GraphicsAPI.GraphicsAPI() -> void -Silk.NET.Windowing.GraphicsAPI.GraphicsAPI(Silk.NET.Windowing.ContextAPI api, Silk.NET.Windowing.APIVersion apiVersion) -> void -Silk.NET.Windowing.GraphicsAPI.GraphicsAPI(Silk.NET.Windowing.ContextAPI api, Silk.NET.Windowing.ContextProfile profile, Silk.NET.Windowing.ContextFlags flags, Silk.NET.Windowing.APIVersion apiVersion) -> void -Silk.NET.Windowing.GraphicsAPI.Profile.get -> Silk.NET.Windowing.ContextProfile -Silk.NET.Windowing.GraphicsAPI.Profile.set -> void -Silk.NET.Windowing.GraphicsAPI.Version.get -> Silk.NET.Windowing.APIVersion -Silk.NET.Windowing.GraphicsAPI.Version.set -> void -Silk.NET.Windowing.IMonitor -Silk.NET.Windowing.IMonitor.Bounds.get -> Silk.NET.Maths.Rectangle -Silk.NET.Windowing.IMonitor.Gamma.get -> float -Silk.NET.Windowing.IMonitor.Gamma.set -> void -Silk.NET.Windowing.IMonitor.GetAllVideoModes() -> System.Collections.Generic.IEnumerable! -Silk.NET.Windowing.IMonitor.Index.get -> int -Silk.NET.Windowing.IMonitor.Name.get -> string! -Silk.NET.Windowing.IMonitor.VideoMode.get -> Silk.NET.Windowing.VideoMode -Silk.NET.Windowing.IView -Silk.NET.Windowing.IView.Close() -> void -Silk.NET.Windowing.IView.Closing -> System.Action? -Silk.NET.Windowing.IView.ContinueEvents() -> void -Silk.NET.Windowing.IView.DoEvents() -> void -Silk.NET.Windowing.IView.DoRender() -> void -Silk.NET.Windowing.IView.DoUpdate() -> void -Silk.NET.Windowing.IView.FocusChanged -> System.Action? -Silk.NET.Windowing.IView.FramebufferResize -> System.Action>? -Silk.NET.Windowing.IView.FramebufferSize.get -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.IView.Handle.get -> nint -Silk.NET.Windowing.IView.Initialize() -> void -Silk.NET.Windowing.IView.Invoke(System.Delegate! d, params object![]! args) -> object! -Silk.NET.Windowing.IView.IsClosing.get -> bool -Silk.NET.Windowing.IView.IsInitialized.get -> bool -Silk.NET.Windowing.IView.Load -> System.Action? -Silk.NET.Windowing.IView.PointToClient(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.IView.PointToFramebuffer(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.IView.PointToScreen(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.IView.Render -> System.Action? -Silk.NET.Windowing.IView.Reset() -> void -Silk.NET.Windowing.IView.Resize -> System.Action>? -Silk.NET.Windowing.IView.Run(System.Action! onFrame) -> void -Silk.NET.Windowing.IView.Time.get -> double -Silk.NET.Windowing.IView.Update -> System.Action? -Silk.NET.Windowing.IViewProperties -Silk.NET.Windowing.IViewProperties.API.get -> Silk.NET.Windowing.GraphicsAPI -Silk.NET.Windowing.IViewProperties.FramesPerSecond.get -> double -Silk.NET.Windowing.IViewProperties.FramesPerSecond.set -> void -Silk.NET.Windowing.IViewProperties.IsContextControlDisabled.get -> bool -Silk.NET.Windowing.IViewProperties.IsContextControlDisabled.set -> void -Silk.NET.Windowing.IViewProperties.IsEventDriven.get -> bool -Silk.NET.Windowing.IViewProperties.IsEventDriven.set -> void -Silk.NET.Windowing.IViewProperties.PreferredBitDepth.get -> Silk.NET.Maths.Vector4D? -Silk.NET.Windowing.IViewProperties.PreferredDepthBufferBits.get -> int? -Silk.NET.Windowing.IViewProperties.PreferredStencilBufferBits.get -> int? -Silk.NET.Windowing.IViewProperties.Samples.get -> int? -Silk.NET.Windowing.IViewProperties.ShouldSwapAutomatically.get -> bool -Silk.NET.Windowing.IViewProperties.ShouldSwapAutomatically.set -> void -Silk.NET.Windowing.IViewProperties.Size.get -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.IViewProperties.UpdatesPerSecond.get -> double -Silk.NET.Windowing.IViewProperties.UpdatesPerSecond.set -> void -Silk.NET.Windowing.IViewProperties.VideoMode.get -> Silk.NET.Windowing.VideoMode -Silk.NET.Windowing.IViewProperties.VSync.get -> bool -Silk.NET.Windowing.IViewProperties.VSync.set -> void -Silk.NET.Windowing.IWindow -Silk.NET.Windowing.IWindow.BorderSize.get -> Silk.NET.Maths.Rectangle -Silk.NET.Windowing.IWindow.FileDrop -> System.Action? -Silk.NET.Windowing.IWindow.IsClosing.get -> bool -Silk.NET.Windowing.IWindow.IsClosing.set -> void -Silk.NET.Windowing.IWindow.Monitor.get -> Silk.NET.Windowing.IMonitor? -Silk.NET.Windowing.IWindow.Monitor.set -> void -Silk.NET.Windowing.IWindow.Move -> System.Action>? -Silk.NET.Windowing.IWindow.Parent.get -> Silk.NET.Windowing.IWindowHost? -Silk.NET.Windowing.IWindow.SetWindowIcon(System.ReadOnlySpan icons) -> void -Silk.NET.Windowing.IWindow.StateChanged -> System.Action? -Silk.NET.Windowing.IWindowHost -Silk.NET.Windowing.IWindowHost.CreateWindow(Silk.NET.Windowing.WindowOptions opts) -> Silk.NET.Windowing.IWindow! -Silk.NET.Windowing.IWindowPlatform -Silk.NET.Windowing.IWindowPlatform.ClearContexts() -> void -Silk.NET.Windowing.IWindowPlatform.GetMainMonitor() -> Silk.NET.Windowing.IMonitor! -Silk.NET.Windowing.IWindowPlatform.GetMonitors() -> System.Collections.Generic.IEnumerable! -Silk.NET.Windowing.IWindowPlatform.GetView(Silk.NET.Windowing.ViewOptions? opts = null) -> Silk.NET.Windowing.IView! -Silk.NET.Windowing.IWindowPlatform.IsApplicable.get -> bool -Silk.NET.Windowing.IWindowPlatform.IsSourceOfView(Silk.NET.Windowing.IView! view) -> bool -Silk.NET.Windowing.IWindowPlatform.IsViewOnly.get -> bool -Silk.NET.Windowing.IWindowProperties -Silk.NET.Windowing.IWindowProperties.IsVisible.get -> bool -Silk.NET.Windowing.IWindowProperties.IsVisible.set -> void -Silk.NET.Windowing.IWindowProperties.Position.get -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.IWindowProperties.Position.set -> void -Silk.NET.Windowing.IWindowProperties.SharedContext.get -> Silk.NET.Core.Contexts.IGLContext? -Silk.NET.Windowing.IWindowProperties.Size.get -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.IWindowProperties.Size.set -> void -Silk.NET.Windowing.IWindowProperties.Title.get -> string! -Silk.NET.Windowing.IWindowProperties.Title.set -> void -Silk.NET.Windowing.IWindowProperties.TransparentFramebuffer.get -> bool -Silk.NET.Windowing.IWindowProperties.WindowBorder.get -> Silk.NET.Windowing.WindowBorder -Silk.NET.Windowing.IWindowProperties.WindowBorder.set -> void -Silk.NET.Windowing.IWindowProperties.WindowClass.get -> string? -Silk.NET.Windowing.IWindowProperties.WindowState.get -> Silk.NET.Windowing.WindowState -Silk.NET.Windowing.IWindowProperties.WindowState.set -> void -Silk.NET.Windowing.Monitor -Silk.NET.Windowing.VideoMode -Silk.NET.Windowing.VideoMode.RefreshRate.get -> int? -Silk.NET.Windowing.VideoMode.Resolution.get -> Silk.NET.Maths.Vector2D? -Silk.NET.Windowing.VideoMode.VideoMode() -> void -Silk.NET.Windowing.VideoMode.VideoMode(int refreshRate) -> void -Silk.NET.Windowing.VideoMode.VideoMode(Silk.NET.Maths.Vector2D? resolution = null, int? refreshRate = null) -> void -Silk.NET.Windowing.ViewOptions -Silk.NET.Windowing.ViewOptions.API.get -> Silk.NET.Windowing.GraphicsAPI -Silk.NET.Windowing.ViewOptions.API.set -> void -Silk.NET.Windowing.ViewOptions.FramesPerSecond.get -> double -Silk.NET.Windowing.ViewOptions.FramesPerSecond.set -> void -Silk.NET.Windowing.ViewOptions.IsContextControlDisabled.get -> bool -Silk.NET.Windowing.ViewOptions.IsContextControlDisabled.set -> void -Silk.NET.Windowing.ViewOptions.IsEventDriven.get -> bool -Silk.NET.Windowing.ViewOptions.IsEventDriven.set -> void -Silk.NET.Windowing.ViewOptions.PreferredBitDepth.get -> Silk.NET.Maths.Vector4D? -Silk.NET.Windowing.ViewOptions.PreferredBitDepth.set -> void -Silk.NET.Windowing.ViewOptions.PreferredDepthBufferBits.get -> int? -Silk.NET.Windowing.ViewOptions.PreferredDepthBufferBits.set -> void -Silk.NET.Windowing.ViewOptions.PreferredStencilBufferBits.get -> int? -Silk.NET.Windowing.ViewOptions.PreferredStencilBufferBits.set -> void -Silk.NET.Windowing.ViewOptions.Samples.get -> int? -Silk.NET.Windowing.ViewOptions.Samples.set -> void -Silk.NET.Windowing.ViewOptions.ShouldSwapAutomatically.get -> bool -Silk.NET.Windowing.ViewOptions.ShouldSwapAutomatically.set -> void -Silk.NET.Windowing.ViewOptions.UpdatesPerSecond.get -> double -Silk.NET.Windowing.ViewOptions.UpdatesPerSecond.set -> void -Silk.NET.Windowing.ViewOptions.VideoMode.get -> Silk.NET.Windowing.VideoMode -Silk.NET.Windowing.ViewOptions.VideoMode.set -> void -Silk.NET.Windowing.ViewOptions.ViewOptions() -> void -Silk.NET.Windowing.ViewOptions.ViewOptions(double framesPerSecond, double updatesPerSecond, Silk.NET.Windowing.GraphicsAPI api, bool isVSync, bool shouldSwapAutomatically, Silk.NET.Windowing.VideoMode videoMode, int? preferredDepthBufferBits = null, int? preferredStencilBufferBits = null, Silk.NET.Maths.Vector4D? preferredBitDepth = null, bool isEventDriven = false, int? samples = null, bool isContextControlDisabled = false) -> void -Silk.NET.Windowing.ViewOptions.ViewOptions(Silk.NET.Windowing.WindowOptions opts) -> void -Silk.NET.Windowing.ViewOptions.VSync.get -> bool -Silk.NET.Windowing.ViewOptions.VSync.set -> void -Silk.NET.Windowing.Window -Silk.NET.Windowing.WindowBorder -Silk.NET.Windowing.WindowBorder.Fixed = 1 -> Silk.NET.Windowing.WindowBorder -Silk.NET.Windowing.WindowBorder.Hidden = 2 -> Silk.NET.Windowing.WindowBorder -Silk.NET.Windowing.WindowBorder.Resizable = 0 -> Silk.NET.Windowing.WindowBorder -Silk.NET.Windowing.WindowExtensions -Silk.NET.Windowing.WindowOptions -Silk.NET.Windowing.WindowOptions.API.get -> Silk.NET.Windowing.GraphicsAPI -Silk.NET.Windowing.WindowOptions.API.set -> void -Silk.NET.Windowing.WindowOptions.FramesPerSecond.get -> double -Silk.NET.Windowing.WindowOptions.FramesPerSecond.set -> void -Silk.NET.Windowing.WindowOptions.IsContextControlDisabled.get -> bool -Silk.NET.Windowing.WindowOptions.IsContextControlDisabled.set -> void -Silk.NET.Windowing.WindowOptions.IsEventDriven.get -> bool -Silk.NET.Windowing.WindowOptions.IsEventDriven.set -> void -Silk.NET.Windowing.WindowOptions.IsVisible.get -> bool -Silk.NET.Windowing.WindowOptions.IsVisible.set -> void -Silk.NET.Windowing.WindowOptions.Position.get -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.WindowOptions.Position.set -> void -Silk.NET.Windowing.WindowOptions.PreferredBitDepth.get -> Silk.NET.Maths.Vector4D? -Silk.NET.Windowing.WindowOptions.PreferredBitDepth.set -> void -Silk.NET.Windowing.WindowOptions.PreferredDepthBufferBits.get -> int? -Silk.NET.Windowing.WindowOptions.PreferredDepthBufferBits.set -> void -Silk.NET.Windowing.WindowOptions.PreferredStencilBufferBits.get -> int? -Silk.NET.Windowing.WindowOptions.PreferredStencilBufferBits.set -> void -Silk.NET.Windowing.WindowOptions.Samples.get -> int? -Silk.NET.Windowing.WindowOptions.Samples.set -> void -Silk.NET.Windowing.WindowOptions.SharedContext.get -> Silk.NET.Core.Contexts.IGLContext? -Silk.NET.Windowing.WindowOptions.ShouldSwapAutomatically.get -> bool -Silk.NET.Windowing.WindowOptions.ShouldSwapAutomatically.set -> void -Silk.NET.Windowing.WindowOptions.Size.get -> Silk.NET.Maths.Vector2D -Silk.NET.Windowing.WindowOptions.Size.set -> void -Silk.NET.Windowing.WindowOptions.Title.get -> string! -Silk.NET.Windowing.WindowOptions.Title.set -> void -Silk.NET.Windowing.WindowOptions.TransparentFramebuffer.get -> bool -Silk.NET.Windowing.WindowOptions.TransparentFramebuffer.set -> void -Silk.NET.Windowing.WindowOptions.UpdatesPerSecond.get -> double -Silk.NET.Windowing.WindowOptions.UpdatesPerSecond.set -> void -Silk.NET.Windowing.WindowOptions.VideoMode.get -> Silk.NET.Windowing.VideoMode -Silk.NET.Windowing.WindowOptions.VideoMode.set -> void -Silk.NET.Windowing.WindowOptions.VSync.get -> bool -Silk.NET.Windowing.WindowOptions.VSync.set -> void -Silk.NET.Windowing.WindowOptions.WindowBorder.get -> Silk.NET.Windowing.WindowBorder -Silk.NET.Windowing.WindowOptions.WindowBorder.set -> void -Silk.NET.Windowing.WindowOptions.WindowClass.get -> string? -Silk.NET.Windowing.WindowOptions.WindowClass.set -> void -Silk.NET.Windowing.WindowOptions.WindowOptions() -> void -Silk.NET.Windowing.WindowOptions.WindowOptions(bool isVisible, Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Vector2D size, double framesPerSecond, double updatesPerSecond, Silk.NET.Windowing.GraphicsAPI api, string! title, Silk.NET.Windowing.WindowState windowState, Silk.NET.Windowing.WindowBorder windowBorder, bool isVSync, bool shouldSwapAutomatically, Silk.NET.Windowing.VideoMode videoMode, int? preferredDepthBufferBits = null, int? preferredStencilBufferBits = null, Silk.NET.Maths.Vector4D? preferredBitDepth = null, bool transparentFramebuffer = false, bool isEventDriven = false, Silk.NET.Core.Contexts.IGLContext? sharedContext = null, int? samples = null, string? windowClass = null, bool isContextControlDisabled = false) -> void -Silk.NET.Windowing.WindowOptions.WindowOptions(Silk.NET.Windowing.ViewOptions opts) -> void -Silk.NET.Windowing.WindowOptions.WindowState.get -> Silk.NET.Windowing.WindowState -Silk.NET.Windowing.WindowOptions.WindowState.set -> void -Silk.NET.Windowing.WindowPlatformAttribute -Silk.NET.Windowing.WindowPlatformAttribute.Type.get -> System.Type! -Silk.NET.Windowing.WindowPlatformAttribute.WindowPlatformAttribute(System.Type! type) -> void -Silk.NET.Windowing.WindowState -Silk.NET.Windowing.WindowState.Fullscreen = 3 -> Silk.NET.Windowing.WindowState -Silk.NET.Windowing.WindowState.Maximized = 2 -> Silk.NET.Windowing.WindowState -Silk.NET.Windowing.WindowState.Minimized = 1 -> Silk.NET.Windowing.WindowState -Silk.NET.Windowing.WindowState.Normal = 0 -> Silk.NET.Windowing.WindowState -static Silk.NET.Windowing.GraphicsAPI.Default.get -> Silk.NET.Windowing.GraphicsAPI -static Silk.NET.Windowing.GraphicsAPI.DefaultVulkan.get -> Silk.NET.Windowing.GraphicsAPI -static Silk.NET.Windowing.GraphicsAPI.None.get -> Silk.NET.Windowing.GraphicsAPI -static Silk.NET.Windowing.Monitor.GetMainMonitor(Silk.NET.Windowing.IView? view) -> Silk.NET.Windowing.IMonitor! -static Silk.NET.Windowing.Monitor.GetMonitors(Silk.NET.Windowing.IView? view) -> System.Collections.Generic.IEnumerable! -static Silk.NET.Windowing.VideoMode.Default.get -> Silk.NET.Windowing.VideoMode -static Silk.NET.Windowing.ViewOptions.Default.get -> Silk.NET.Windowing.ViewOptions -static Silk.NET.Windowing.ViewOptions.DefaultVulkan.get -> Silk.NET.Windowing.ViewOptions -static Silk.NET.Windowing.Window.Add(Silk.NET.Windowing.IWindowPlatform! platform) -> void -static Silk.NET.Windowing.Window.ClearCurrentContexts(Silk.NET.Windowing.IView! view) -> void -static Silk.NET.Windowing.Window.Create(Silk.NET.Windowing.WindowOptions options) -> Silk.NET.Windowing.IWindow! -static Silk.NET.Windowing.Window.GetOrDefault() -> T? -static Silk.NET.Windowing.Window.GetView(Silk.NET.Windowing.ViewOptions? options = null) -> Silk.NET.Windowing.IView! -static Silk.NET.Windowing.Window.GetWindowPlatform(bool viewOnly) -> Silk.NET.Windowing.IWindowPlatform? -static Silk.NET.Windowing.Window.IsViewOnly.get -> bool -static Silk.NET.Windowing.Window.Platforms.get -> System.Collections.Generic.IReadOnlyCollection! -static Silk.NET.Windowing.Window.Prioritize(Silk.NET.Windowing.IWindowPlatform! platform) -> void -static Silk.NET.Windowing.Window.PrioritizeGlfw() -> void -static Silk.NET.Windowing.Window.PrioritizeSdl() -> void -static Silk.NET.Windowing.Window.Remove(Silk.NET.Windowing.IWindowPlatform! platform) -> void -static Silk.NET.Windowing.Window.ShouldLoadFirstPartyPlatforms(bool shouldLoad) -> void -static Silk.NET.Windowing.Window.TryAdd(string! assemblyName) -> bool -static Silk.NET.Windowing.WindowExtensions.Center(this Silk.NET.Windowing.IWindow! window, Silk.NET.Windowing.IMonitor? monitor = null) -> void -static Silk.NET.Windowing.WindowExtensions.ClearContext(this Silk.NET.Windowing.IView! view) -> void -static Silk.NET.Windowing.WindowExtensions.GetFullSize(this Silk.NET.Windowing.IWindow! window) -> Silk.NET.Maths.Vector2D -static Silk.NET.Windowing.WindowExtensions.Invoke(this Silk.NET.Windowing.IView! view, System.Action! t) -> void -static Silk.NET.Windowing.WindowExtensions.Invoke(this Silk.NET.Windowing.IView! view, System.Func! t) -> T -static Silk.NET.Windowing.WindowExtensions.MakeCurrent(this Silk.NET.Windowing.IView! view) -> void -static Silk.NET.Windowing.WindowExtensions.Run(this Silk.NET.Windowing.IView! view) -> void -static Silk.NET.Windowing.WindowExtensions.SetDefaultIcon(this Silk.NET.Windowing.IWindow! window) -> void -static Silk.NET.Windowing.WindowExtensions.SetWindowIcon(this Silk.NET.Windowing.IWindow! window, ref Silk.NET.Core.RawImage icon) -> void -static Silk.NET.Windowing.WindowExtensions.SwapBuffers(this Silk.NET.Windowing.IView! view) -> void -static Silk.NET.Windowing.WindowOptions.Default.get -> Silk.NET.Windowing.WindowOptions -static Silk.NET.Windowing.WindowOptions.DefaultVulkan.get -> Silk.NET.Windowing.WindowOptions -Silk.NET.Windowing.WindowOptions.SharedContext.set -> void diff --git a/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Unshipped.txt b/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Unshipped.txt deleted file mode 100644 index 1375c83df3..0000000000 --- a/src/Windowing/Silk.NET.Windowing.Common/PublicAPI/net7.0/PublicAPI.Unshipped.txt +++ /dev/null @@ -1,9 +0,0 @@ -#nullable enable -Silk.NET.Windowing.IWindowPlatform.Name.get -> string! -Silk.NET.Windowing.IWindowProperties.TopMost.get -> bool -Silk.NET.Windowing.IWindowProperties.TopMost.set -> void -static Silk.NET.Windowing.Window.DefaultWindowClass.get -> string -Silk.NET.Windowing.VideoMode.AspectRatioEstimate.get -> Silk.NET.Maths.Vector2D? -Silk.NET.Windowing.WindowOptions.TopMost.get -> bool -Silk.NET.Windowing.WindowOptions.TopMost.set -> void -Silk.NET.Windowing.WindowOptions.WindowOptions(bool isVisible, Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Vector2D size, double framesPerSecond, double updatesPerSecond, Silk.NET.Windowing.GraphicsAPI api, string! title, Silk.NET.Windowing.WindowState windowState, Silk.NET.Windowing.WindowBorder windowBorder, bool isVSync, bool shouldSwapAutomatically, Silk.NET.Windowing.VideoMode videoMode, int? preferredDepthBufferBits = null, int? preferredStencilBufferBits = null, Silk.NET.Maths.Vector4D? preferredBitDepth = null, bool transparentFramebuffer = false, bool topMost = false, bool isEventDriven = false, Silk.NET.Core.Contexts.IGLContext? sharedContext = null, int? samples = null, string? windowClass = null, bool isContextControlDisabled = false) -> void diff --git a/src/Windowing/Silk.NET.Windowing.Common/Silk.NET.Windowing.Common.csproj b/src/Windowing/Silk.NET.Windowing.Common/Silk.NET.Windowing.Common.csproj index 5bc19a3438..a7eb3e435c 100644 --- a/src/Windowing/Silk.NET.Windowing.Common/Silk.NET.Windowing.Common.csproj +++ b/src/Windowing/Silk.NET.Windowing.Common/Silk.NET.Windowing.Common.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netstandard2.1;net7.0 + netstandard2.0;netstandard2.1 8.0 true Silk.NET.Windowing From c3a0dc78344f6fafe206f8b65054f1d1bcb4fc9e Mon Sep 17 00:00:00 2001 From: Dylan Perks Date: Sun, 20 Aug 2023 13:06:58 -0500 Subject: [PATCH 12/12] minor tweaks --- .nuke/build.schema.json | 8 +++++--- src/Lab/Experiments/TimeTrials/Program.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 0c84b35cc7..5b6acdb13d 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -142,7 +142,6 @@ "items": { "type": "string", "enum": [ - "Angle", "Assimp", "BuildLibSilkDroid", "Clean", @@ -160,9 +159,11 @@ "RegenerateBindings", "Restore", "SDL2", + "Shaderc", "ShipApi", "SignPackages", "Sln", + "SPIRVCross", "SPIRVReflect", "SwiftShader", "Test", @@ -183,7 +184,6 @@ "items": { "type": "string", "enum": [ - "Angle", "Assimp", "BuildLibSilkDroid", "Clean", @@ -201,9 +201,11 @@ "RegenerateBindings", "Restore", "SDL2", + "Shaderc", "ShipApi", "SignPackages", "Sln", + "SPIRVCross", "SPIRVReflect", "SwiftShader", "Test", @@ -231,4 +233,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/Lab/Experiments/TimeTrials/Program.cs b/src/Lab/Experiments/TimeTrials/Program.cs index 1514c9ea9a..4db36a5b4f 100644 --- a/src/Lab/Experiments/TimeTrials/Program.cs +++ b/src/Lab/Experiments/TimeTrials/Program.cs @@ -5,7 +5,7 @@ using Silk.NET.Core; using Silk.NET.Windowing; -var timeWindow = new TimeWindow(false); +var timeWindow = new TimeWindow(); var bag = new ConcurrentBag(); var sw = new Stopwatch(); Console.Write("Enter frames per second: ");