Skip to content

Commit

Permalink
Fix window title
Browse files Browse the repository at this point in the history
  • Loading branch information
deccer committed Jan 1, 2024
1 parent 8d75a8a commit 4a0db2c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion examples/Complex/Complex/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"ResolutionHeight": 1050,
"ResolutionScale": 1.0,
"WindowMode": "WindowedBorderless",
"IsVsyncEnabled": true
"IsVsyncEnabled": true,
"Title": "Complex"
},
"ContextSettings": {
"TargetGLVersion": "4.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"ResolutionHeight": 1080,
"ResolutionScale": 1.0,
"WindowMode": "WindowedBorderless",
"IsVsyncEnabled": true
"IsVsyncEnabled": true,
"Title": "ComputeConvolution"
},
"ContextSettings": {
"TargetGLVersion": "4.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"ResolutionHeight": 1080,
"ResolutionScale": 1.0,
"WindowMode": "WindowedBorderless",
"IsVsyncEnabled": true
"IsVsyncEnabled": true,
"Title": "DeferredRendering"
},
"ContextSettings": {
"TargetGLVersion": "4.6",
Expand Down
3 changes: 2 additions & 1 deletion examples/ForwardRendering/ForwardRendering/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"ResolutionHeight": 1080,
"ResolutionScale": 1.0,
"WindowMode": "WindowedBorderless",
"IsVsyncEnabled": true
"IsVsyncEnabled": true,
"Title": "ForwardRendering"
},
"ContextSettings": {
"TargetGLVersion": "4.6",
Expand Down
3 changes: 2 additions & 1 deletion examples/HelloWindow/HelloWindow/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"ResolutionHeight": 1050,
"ResolutionScale": 1.0,
"WindowMode": "WindowedBorderless",
"IsVsyncEnabled": true
"IsVsyncEnabled": true,
"Title": "HelloWindow"
},
"ContextSettings": {
"TargetGLVersion": "4.6",
Expand Down
5 changes: 3 additions & 2 deletions src/EngineKit/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/EngineKit/WindowSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public class WindowSettings
public WindowMode WindowMode { get; set; }

public bool IsVsyncEnabled { get; set; }

public string Title { get; set; } = "EngineKit";
}

0 comments on commit 4a0db2c

Please sign in to comment.