Skip to content

Commit 83843c3

Browse files
committed
Shut down imgui when exit.
1 parent d743050 commit 83843c3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • examples/freeglut_opengl2_example

examples/freeglut_opengl2_example/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ bool keyboardEvent(unsigned char nChar, int nX, int nY)
7575
ImGuiIO& io = ImGui::GetIO();
7676
io.AddInputCharacter(nChar);
7777

78+
if (nChar == 27) //Esc-key
79+
glutLeaveMainLoop();
80+
7881
return true;
7982
}
8083

@@ -211,5 +214,7 @@ int main(int argc, char **argv)
211214
init();
212215
glutMainLoop();
213216

217+
ImGui_ImplGLUT_Shutdown();
218+
214219
return 0;
215220
}

0 commit comments

Comments
 (0)