Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Robust.Client/Graphics/Clyde/Clyde.Windowing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ public IClydeWindow CreateWindow(WindowCreateParameters parameters)
if (parameters.Owner != null)
owner = ((WindowHandle)parameters.Owner).Reg;

parameters.Main = isMain;
var (reg, error) = _windowing!.WindowCreate(glSpec, parameters, share, owner);

if (reg != null)
Expand Down
3 changes: 2 additions & 1 deletion Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ private void BlitThreadDoSecondaryWindowBlit(WindowData window)
{
window.BlitDoneEvent?.Set();
}
Clyde._windowing!.WindowSwapBuffers(window.Reg);
// Single buffered secondary windows, Steam overlay triggers memory leak with secondary double buffers
GL.Finish();
if (!window.UnlockBeforeSwap)
{
window.BlitDoneEvent?.Set();
Expand Down
5 changes: 5 additions & 0 deletions Robust.Client/Graphics/Clyde/Windowing/Sdl3.Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ private void WinThreadWinDestroy(CmdWinDestroy cmd)
SDL.SDL_GL_SetAttribute(
GLAttr.SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
s.Profile == GLContextProfile.Es ? 0 : 1);

// Steam overlay causes memory leak with multiple double buffered windows
if (!parameters.Main)
SDL.SDL_GL_SetAttribute(GLAttr.SDL_GL_DOUBLEBUFFER, 0);

int ctxFlags = 0;
#if DEBUG
ctxFlags |= SDL.SDL_GL_CONTEXT_DEBUG_FLAG;
Expand Down
1 change: 1 addition & 0 deletions Robust.Client/Graphics/WindowCreateParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public sealed class WindowCreateParameters
public bool Visible = true;
public IClydeMonitor? Monitor;
public bool Fullscreen;
public bool Main;

/// <summary>
/// The window that will "own" this window.
Expand Down
Loading