-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPushdown.h
More file actions
39 lines (31 loc) · 1.1 KB
/
Pushdown.h
File metadata and controls
39 lines (31 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Pushdown.h
* --------
* This header file contains definitions for the functionality that controls the pushdown
* notifications used in-game. Messages can be queued into the system and updated. Rendering
* of these messages is handled the draw module though. Each message length is max 31 characters.
*/
#ifndef PUSHDOWN_H
#define PUSHDOWN_H
#include <SDL/SDL.h>
typedef struct
{
Uint32 startTime;
char message[32];
} PushMessage;
/* updatePushMessages()
* Purpose: Essentially gets rid of any old messages that need to die; call every loop
* Returns: N/A
*/
void updatePushMessages();
/* pushNewMessage()
* Purpose: Attempts to push a new message to the system; if the supplied text is over 50 characters in length it may be cut off
* Returns: 0 on success, 1 if the queue is full, 2 on some other failure; output MAY be written to stderr
*/
int pushNewMessage(char* text);
/* getCurrentMessage()
* Purpose: Gets the latest message; usually for the draw module
* Returns: Pointer to current message in system, NULL if no current message to push
*/
PushMessage* getCurrentMessage();
#endif