1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
* Mupen64plus - osd.h *
3
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4
* Copyright (C) 2008 Nmn, Ebenblues *
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
25
/******************************************************************
28
\ __|__/ | Offset always effects the same:
29
| | | +X = Leftward +Y = Upward
30
3-| 4 |-5 | With no offset, the text will touch the border.
34
*******************************************************************/
36
OSD_TOP_LEFT, // 0 in the picture above
37
OSD_TOP_CENTER, // 1 in the picture above
38
OSD_TOP_RIGHT, // 2 in the picture above
40
OSD_MIDDLE_LEFT, // 3 in the picture above
41
OSD_MIDDLE_CENTER, // 4 in the picture above
42
OSD_MIDDLE_RIGHT, // 5 in the picture above
44
OSD_BOTTOM_LEFT, // 6 in the picture above
45
OSD_BOTTOM_CENTER, // 7 in the picture above
46
OSD_BOTTOM_RIGHT, // 8 in the picture above
51
enum osd_message_state {
52
OSD_APPEAR, // OSD message is appearing on the screen
53
OSD_DISPLAY, // OSD message is being displayed on the screen
54
OSD_DISAPPEAR, // OSD message is disappearing from the screen
59
enum osd_animation_type {
67
char *text; // Text that this object will have when displayed
68
enum osd_corner corner; // One of the 9 corners
69
float xoffset; // Relative X position
70
float yoffset; // Relative Y position
71
float color[3]; // Red, Green, Blue values
72
float sizebox[4]; // bounding box (xmin, ymin, xmax, ymax)
73
int state; // display state of current message
74
enum osd_animation_type animation[OSD_NUM_STATES]; // animations for each display state
75
unsigned int timeout[OSD_NUM_STATES]; // timeouts for each display state
76
#define OSD_INFINITE_TIMEOUT 0xffffffff
77
unsigned int frames; // number of frames in this state
80
enum { R, G, B }; // for referencing color array
86
void osd_init(int width, int height);
89
osd_message_t * osd_new_message(enum osd_corner, const char *, ...);
90
void osd_update_message(osd_message_t *, const char *, ...);
91
void osd_delete_message(osd_message_t *);
92
void osd_message_set_corner(osd_message_t *, enum osd_corner);
93
void osd_message_set_static(osd_message_t *);
94
osd_message_t * osd_message_valid(osd_message_t *);