aboutsummaryrefslogtreecommitdiff
path: root/subprojects/d2tk/pugl/doc/c/shutting-down.rst
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/d2tk/pugl/doc/c/shutting-down.rst')
-rw-r--r--subprojects/d2tk/pugl/doc/c/shutting-down.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/subprojects/d2tk/pugl/doc/c/shutting-down.rst b/subprojects/d2tk/pugl/doc/c/shutting-down.rst
new file mode 100644
index 0000000..dfb56cd
--- /dev/null
+++ b/subprojects/d2tk/pugl/doc/c/shutting-down.rst
@@ -0,0 +1,20 @@
+.. default-domain:: c
+.. highlight:: c
+
+#############
+Shutting Down
+#############
+
+When a view is closed,
+it will receive a :struct:`PuglEventClose`.
+An application may also set a flag based on user input or other conditions,
+which can be used to break out of the main loop and stop calling :func:`puglUpdate`.
+
+When the main event loop has finished running,
+any views and the world need to be destroyed, in that order.
+For example:
+
+.. code-block:: c
+
+ puglFreeView(view);
+ puglFreeWorld(world);