Skip to content

Commit a6cc136

Browse files
committed
Fixed issue that caused crash when using GameWindow class without an OpenGL context.
1 parent 94a29f7 commit a6cc136

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

GLFW.NET/Game/GameWindow.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ public GameWindow(int width, int height, string title, Monitor monitor, Window s
457457
_title = title;
458458
Window = Glfw.CreateWindow(width, height, title, monitor, share);
459459
SetHandle(Window);
460-
MakeCurrent();
460+
if (Glfw.GetClientApi(this) != ClientApi.None)
461+
MakeCurrent();
461462
BindCallbacks();
462463
}
463464

@@ -598,6 +599,9 @@ public void SetSizeLimits(int minWidth, int minHeight, int maxWidth, int maxHeig
598599

599600
/// <summary>
600601
/// Swaps the front and back buffers when rendering with OpenGL or OpenGL ES.
602+
/// <para>
603+
/// This should not be called on a window that is not using an OpenGL or OpenGL ES context (.i.e. Vulkan).
604+
/// </para>
601605
/// </summary>
602606
public void SwapBuffers() => Glfw.SwapBuffers(Window);
603607

0 commit comments

Comments
 (0)