Skip to content

Commit

Permalink
Removed WindowStyles, added support TransparentFramebuffer, Decorated…
Browse files Browse the repository at this point in the history
…,Resizable
  • Loading branch information
Tornado-Technology committed Jul 10, 2024
1 parent 947cabb commit b3eb798
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 @@ -85,6 +85,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 @@ -97,12 +101,7 @@ 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), null);
}

Expand Down
11 changes: 5 additions & 6 deletions Hypercube.Client/Graphics/Windows/WindowCreateSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ 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 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 b3eb798

Please sign in to comment.