Skip to content

Commit

Permalink
Merge branch 'master' into do-flip
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryImMouse authored Jul 10, 2024
2 parents 8624ad6 + b3eb798 commit 1234317
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public WindowCreateResult WindowCreate(ContextInfo? context, WindowCreateSetting
if (settings.StencilBits is not null)
GLFW.WindowHint(WindowHintInt.StencilBits, settings.StencilBits.Value);

GLFW.WindowHint(WindowHintBool.Resizable, settings.Resizable);
GLFW.WindowHint(WindowHintBool.TransparentFramebuffer, settings.TransparentFramebuffer);
GLFW.WindowHint(WindowHintBool.Decorated, settings.Decorated);

var window = GLFW.CreateWindow(
settings.Width,
settings.Height,
Expand All @@ -100,13 +104,8 @@ public WindowCreateResult WindowCreate(ContextInfo? context, WindowCreateSetting
Terminate();
return new WindowCreateResult(null, GLFWHelper.GetError());
}


// Apply GLFW WindowStyle
if (settings.NoTitleBar)
GLFW.WindowHint(WindowHintBool.Decorated, false);

return new WindowCreateResult(WindowSetup(window, settings), null);
return new WindowCreateResult(WindowSetup(window), null);
}

private GlfwWindowRegistration WindowSetup(Window* window, WindowCreateSettings settings)
Expand Down
9 changes: 4 additions & 5 deletions Hypercube.Client/Graphics/Windows/WindowCreateSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ public class WindowCreateSettings
{
public int Width => Size.X;
public int Height => Size.Y;

public bool NoTitleBar => Styles.HasFlag(WindowStyles.NoTitleBar);
public bool NoTitleOptions => Styles.HasFlag(WindowStyles.NoTitleOptions);

public string Title = "Hypercube Window";
public Vector2Int Size = new(1280, 720);
public WindowStyles Styles;
public Version Version;
public ITexture[]? WindowImages = null;

public IMonitorHandle? Monitor;

public bool Resizable = true;
public bool TransparentFramebuffer = false;
public bool Decorated = true;

public int? RedBits = 8;
public int? GreenBits = 8;
Expand Down
23 changes: 0 additions & 23 deletions Hypercube.Client/Graphics/Windows/WindowStyles.cs

This file was deleted.

0 comments on commit 1234317

Please sign in to comment.