changeset 512:9877e34bb6eb

core: doxygenize clock
author David Demelier <markand@malikania.fr>
date Sat, 04 Mar 2023 10:22:42 +0100
parents a1b118127f47
children b59a1f00bf80
files libmlk-core/mlk/core/clock.h
diffstat 1 files changed, 34 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmlk-core/mlk/core/clock.h	Sat Mar 04 10:18:10 2023 +0100
+++ b/libmlk-core/mlk/core/clock.h	Sat Mar 04 10:22:42 2023 +0100
@@ -19,19 +19,51 @@
 #ifndef MLK_CORE_CLOCK_H
 #define MLK_CORE_CLOCK_H
 
+/**
+ * \file mlk/core/clock.h
+ * \brief Track elapsed time
+ *
+ * This simple module provide functions to keep track of elapsed time.
+ *
+ * It is mostly used in the game loop because most objects in the overall API
+ * get the frame ticks instead.
+ */
+
 #include "core.h"
 
+/**
+ * \struct mlk_clock
+ * \brief Clock structure
+ *
+ * This structure is non-opaque but has no public fields.
+ */
 struct mlk_clock {
+	/** \cond MLK_PRIVATE_DECLS */
 	unsigned int ticks;
+	/** \endcond MLK_PRIVATE_DECLS */
 };
 
 MLK_CORE_BEGIN_DECLS
 
+/**
+ * Start or reset the clock.
+ *
+ * \pre clock != NULL
+ * \param clock the clock timer
+ */
 void
-mlk_clock_start(struct mlk_clock *);
+mlk_clock_start(struct mlk_clock *clock);
 
+/**
+ * Returns the number of elapsed milliseconds since last call to
+ * ::mlk_clock_start.
+ *
+ * \pre clock != NULL
+ * \param clock the clock timer
+ * \return the number of elapsed milliseconds
+ */
 unsigned int
-mlk_clock_elapsed(const struct mlk_clock *);
+mlk_clock_elapsed(const struct mlk_clock *clock);
 
 MLK_CORE_END_DECLS