Skip to content

Commit 6eb4031

Browse files
MarkOatesSiegeLord
authored andcommitted
Add "al_is_ttf_addon_initialized"
1 parent 34ae30b commit 6eb4031

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

addons/ttf/allegro5/allegro_ttf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ALLEGRO_TTF_FUNC(ALLEGRO_FONT *, al_load_ttf_font_f, (ALLEGRO_FILE *file, char c
3939
ALLEGRO_TTF_FUNC(ALLEGRO_FONT *, al_load_ttf_font_stretch, (char const *filename, int w, int h, int flags));
4040
ALLEGRO_TTF_FUNC(ALLEGRO_FONT *, al_load_ttf_font_stretch_f, (ALLEGRO_FILE *file, char const *filename, int w, int h, int flags));
4141
ALLEGRO_TTF_FUNC(bool, al_init_ttf_addon, (void));
42+
ALLEGRO_TTF_FUNC(bool, al_is_ttf_addon_initialized, (void));
4243
ALLEGRO_TTF_FUNC(void, al_shutdown_ttf_addon, (void));
4344
ALLEGRO_TTF_FUNC(uint32_t, al_get_allegro_ttf_version, (void));
4445

addons/ttf/ttf.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,14 @@ bool al_init_ttf_addon(void)
11341134
}
11351135

11361136

1137+
/* Function: al_is_ttf_addon_initialized
1138+
*/
1139+
bool al_is_ttf_addon_initialized(void)
1140+
{
1141+
return ttf_inited;
1142+
}
1143+
1144+
11371145
/* Function: al_shutdown_ttf_addon
11381146
*/
11391147
void al_shutdown_ttf_addon(void)

docs/src/refman/font.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,12 @@ Call this after [al_init_font_addon] to make [al_load_font] recognize
702702

703703
Returns true on success, false on failure.
704704

705+
### API: al_is_ttf_addon_initialized
706+
707+
Returns true if the TTF addon has been initialized, otherwise returns false.
708+
709+
See also: [al_init_ttf_addon], [al_shutdown_ttf_addon]
710+
705711
### API: al_shutdown_ttf_addon
706712

707713
Unloads the ttf addon again. You normally don't need to call this.

0 commit comments

Comments
 (0)