From 4a0db2c0aac038d9ae1366b94c12adf8afbb67cd Mon Sep 17 00:00:00 2001 From: deccer Date: Mon, 1 Jan 2024 17:05:13 +0100 Subject: [PATCH] Fix window title --- examples/Complex/Complex/appsettings.json | 3 ++- .../ComputeConvolution/ComputeConvolution/appsettings.json | 3 ++- .../DeferredRendering/DeferredRendering/appsettings.json | 3 ++- examples/ForwardRendering/ForwardRendering/appsettings.json | 3 ++- examples/HelloWindow/HelloWindow/appsettings.json | 3 ++- src/EngineKit/Application.cs | 5 +++-- src/EngineKit/WindowSettings.cs | 2 ++ 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/examples/Complex/Complex/appsettings.json b/examples/Complex/Complex/appsettings.json index b522dc9..5ecf2d4 100644 --- a/examples/Complex/Complex/appsettings.json +++ b/examples/Complex/Complex/appsettings.json @@ -21,7 +21,8 @@ "ResolutionHeight": 1050, "ResolutionScale": 1.0, "WindowMode": "WindowedBorderless", - "IsVsyncEnabled": true + "IsVsyncEnabled": true, + "Title": "Complex" }, "ContextSettings": { "TargetGLVersion": "4.6", diff --git a/examples/ComputeConvolution/ComputeConvolution/appsettings.json b/examples/ComputeConvolution/ComputeConvolution/appsettings.json index cea5932..5a171ec 100644 --- a/examples/ComputeConvolution/ComputeConvolution/appsettings.json +++ b/examples/ComputeConvolution/ComputeConvolution/appsettings.json @@ -21,7 +21,8 @@ "ResolutionHeight": 1080, "ResolutionScale": 1.0, "WindowMode": "WindowedBorderless", - "IsVsyncEnabled": true + "IsVsyncEnabled": true, + "Title": "ComputeConvolution" }, "ContextSettings": { "TargetGLVersion": "4.6", diff --git a/examples/DeferredRendering/DeferredRendering/appsettings.json b/examples/DeferredRendering/DeferredRendering/appsettings.json index e3350a9..3f07166 100644 --- a/examples/DeferredRendering/DeferredRendering/appsettings.json +++ b/examples/DeferredRendering/DeferredRendering/appsettings.json @@ -21,7 +21,8 @@ "ResolutionHeight": 1080, "ResolutionScale": 1.0, "WindowMode": "WindowedBorderless", - "IsVsyncEnabled": true + "IsVsyncEnabled": true, + "Title": "DeferredRendering" }, "ContextSettings": { "TargetGLVersion": "4.6", diff --git a/examples/ForwardRendering/ForwardRendering/appsettings.json b/examples/ForwardRendering/ForwardRendering/appsettings.json index cf9920d..cf5a04b 100644 --- a/examples/ForwardRendering/ForwardRendering/appsettings.json +++ b/examples/ForwardRendering/ForwardRendering/appsettings.json @@ -21,7 +21,8 @@ "ResolutionHeight": 1080, "ResolutionScale": 1.0, "WindowMode": "WindowedBorderless", - "IsVsyncEnabled": true + "IsVsyncEnabled": true, + "Title": "ForwardRendering" }, "ContextSettings": { "TargetGLVersion": "4.6", diff --git a/examples/HelloWindow/HelloWindow/appsettings.json b/examples/HelloWindow/HelloWindow/appsettings.json index b522dc9..e05169c 100644 --- a/examples/HelloWindow/HelloWindow/appsettings.json +++ b/examples/HelloWindow/HelloWindow/appsettings.json @@ -21,7 +21,8 @@ "ResolutionHeight": 1050, "ResolutionScale": 1.0, "WindowMode": "WindowedBorderless", - "IsVsyncEnabled": true + "IsVsyncEnabled": true, + "Title": "HelloWindow" }, "ContextSettings": { "TargetGLVersion": "4.6", diff --git a/src/EngineKit/Application.cs b/src/EngineKit/Application.cs index 99578fb..7a1c879 100644 --- a/src/EngineKit/Application.cs +++ b/src/EngineKit/Application.cs @@ -234,7 +234,7 @@ protected virtual bool Initialize() Glfw.WindowHint(Glfw.WindowOpenGLContextHint.DebugContext, _contextSettings.Value.IsDebugContext); Glfw.WindowHint(Glfw.WindowOpenGLContextHint.Profile, Glfw.OpenGLProfile.Core); - // MESA overrides - useful for windows on intel iGPU + // show MESA overrides - useful for windows on intel iGPU var environmentVariables = Environment.GetEnvironmentVariables(); if (environmentVariables.Contains("LIBGL_DEBUG")) { @@ -253,10 +253,11 @@ protected virtual bool Initialize() var mesaGlslVersionOverride = environmentVariables["MESA_GLSL_VERSION_OVERRIDE"]; _logger.Information("{Category}: MESA_GLSL_VERSION_OVERRIDE={MesaGlVersionOverride}", "Environment", mesaGlslVersionOverride); } + _windowHandle = Glfw.CreateWindow( _applicationContext.WindowSize.X, _applicationContext.WindowSize.Y, - "OpenSpace", + _windowSettings.Value.Title, monitorHandle, nint.Zero); if (_windowHandle == nint.Zero) diff --git a/src/EngineKit/WindowSettings.cs b/src/EngineKit/WindowSettings.cs index 4295741..56a5233 100644 --- a/src/EngineKit/WindowSettings.cs +++ b/src/EngineKit/WindowSettings.cs @@ -11,4 +11,6 @@ public class WindowSettings public WindowMode WindowMode { get; set; } public bool IsVsyncEnabled { get; set; } + + public string Title { get; set; } = "EngineKit"; } \ No newline at end of file