Deinit devmode more cleanly

This commit is contained in:
Mitchell Hashimoto
2022-11-06 17:26:01 -08:00
parent 135b859b8f
commit fd304c9338
4 changed files with 45 additions and 34 deletions

View File

@@ -387,10 +387,8 @@ pub fn finalizeWindowInit(self: *const OpenGL, window: glfw.Window) !void {
_ = window;
}
/// This is called only after the first window is opened. This may be
/// called multiple times if all windows are closed and a new one is
/// reopened.
pub fn firstWindowInit(self: *const OpenGL, window: glfw.Window) !void {
/// This is called if this renderer runs DevMode.
pub fn initDevMode(self: *const OpenGL, window: glfw.Window) !void {
_ = self;
if (DevMode.enabled) {
@@ -403,8 +401,10 @@ pub fn firstWindowInit(self: *const OpenGL, window: glfw.Window) !void {
}
}
/// This is called only when the last window is destroyed.
pub fn lastWindowDeinit() void {
/// This is called if this renderer runs DevMode.
pub fn deinitDevMode(self: *const OpenGL) void {
_ = self;
if (DevMode.enabled) {
imgui.ImplOpenGL3.shutdown();
imgui.ImplGlfw.shutdown();