aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/graphics
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-06 15:55:42 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-06 15:55:42 +0100
commitcb679636f77fe2a03e8dab3a511e28e1ab898316 (patch)
treeb03cada4a37a50eb50cef1e21c75c56d938868a8 /include/mgl/graphics
parente2e7c0bf0747d55967c4be6374f3611cd96babb6 (diff)
Fix exit being called when closing window, respond to wm ping, add is_open function to window
Diffstat (limited to 'include/mgl/graphics')
-rw-r--r--include/mgl/graphics/text.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/include/mgl/graphics/text.h b/include/mgl/graphics/text.h
index f832605..aca0650 100644
--- a/include/mgl/graphics/text.h
+++ b/include/mgl/graphics/text.h
@@ -16,33 +16,27 @@ typedef struct mgl_font mgl_font;
typedef struct mgl_context mgl_context;
typedef struct {
- /* Optional */
- void (*before_syntax_highlight)(void *userdata);
- /* Return true if the text format should be changed. Optional */
- bool (*syntax_highlight)(void *userdata, const char *str, size_t size, mgl_color *color);
- void *userdata;
-} mgl_text_options;
-
-typedef struct {
mgl_font *font; /* nullable */
const char *text; /* nullable */
size_t text_size;
mgl_color color;
mgl_vec2f position;
mgl_vec2f bounds;
- mgl_text_options options;
} mgl_text;
/*
Note: keeps a reference to |text|. |text| needs to be valid as long as |self| is used.
|font| and |text| may be NULL.
- |load_options| can be NULL, in which case the default options are used.
*/
-int mgl_text_init(mgl_text *self, mgl_font *font, const char *str, size_t str_size, mgl_text_options *options);
+int mgl_text_init(mgl_text *self, mgl_font *font, const char *str, size_t str_size);
void mgl_text_deinit(mgl_text *self);
-/* Note: keeps a reference to |text|. |text| needs to be valid as long as |self| is used. |text| may be NULL. */
-void mgl_text_set_string(mgl_text *self, const char *str, size_t str_size);
+/*
+ Note: keeps a reference to |text|. |text| needs to be valid as long as |self| is used.
+ |text| may be NULL.
+ |str| will be checked if its a valid utf8 string.
+*/
+int mgl_text_set_string(mgl_text *self, const char *str, size_t str_size);
/* |font| may be NULL */
void mgl_text_set_font(mgl_text *self, mgl_font *font);
void mgl_text_set_position(mgl_text *self, mgl_vec2f position);