comparison libmlk-adventure/adventure/trace_hud.h @ 243:71b3b7036de7

misc: lot of cleanups, - prefix libraries with libmlk, - move assets from source directories closes #2520, - prefix header guards closes #2519
author David Demelier <markand@malikania.fr>
date Sat, 28 Nov 2020 22:37:30 +0100
parents libadventure/adventure/trace_hud.h@b386d25832c8
children e28429dbdaaf
comparison
equal deleted inserted replaced
242:4c24604efcab 243:71b3b7036de7
1 /*
2 * trace_hud.h -- on screen hud
3 *
4 * Copyright (c) 2020 David Demelier <markand@malikania.fr>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #ifndef MOLKO_MOLKO_TRACE_HUD_H
20 #define MOLKO_MOLKO_TRACE_HUD_H
21
22 /**
23 * \file trace_hud.h
24 * \brief On screen hud
25 */
26
27 struct theme;
28
29 /**
30 * \brief Default time to remove messages.
31 */
32 #define TRACE_HUD_TIMEOUT_DEFAULT (3000)
33
34 /**
35 * \brief Trace HUD options.
36 */
37 struct trace_hud {
38 struct theme *theme; /*!< (+&?) Theme to use. */
39 unsigned int timeout; /*!< (+) Timeout to remove messages. */
40 };
41
42 /**
43 * Global trace HUD options.
44 */
45 extern struct trace_hud trace_hud;
46
47 /**
48 * Handler to use as \ref trace_handler.
49 *
50 * \pre str != NULL
51 * \param str the line to store
52 */
53 void
54 trace_hud_handler(const char *str);
55
56 /**
57 * Update the HUD.
58 *
59 * \param ticks elapsed milliseconds since last frame.
60 */
61 void
62 trace_hud_update(unsigned int ticks);
63
64 /**
65 * Draw the HUD.
66 */
67 void
68 trace_hud_draw(void);
69
70 /**
71 * Clear the hud.
72 */
73 void
74 trace_hud_clear(void);
75
76 #endif /* !MOLKO_MOLKO_TRACE_HUD_H */