diff options
| author | Andre Weissflog <floooh@gmail.com> | 2021-08-21 14:20:49 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2021-08-21 14:20:49 +0200 |
| commit | 9c2d96ddbbbb60acca9204eff9e28d141c082863 (patch) | |
| tree | 495c9fbf9b63e16406021751751217b7977c5c9f /util/sokol_debugtext.h | |
| parent | a4ceb3ab5e9bae32127df45aa42d39d039048d90 (diff) | |
minor API tweaks in sokol_gl.h and sokol_debugtext.h (see CHANGELOG.md)
Diffstat (limited to 'util/sokol_debugtext.h')
| -rw-r--r-- | util/sokol_debugtext.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/util/sokol_debugtext.h b/util/sokol_debugtext.h index d82d8d0f..02f5d3b7 100644 --- a/util/sokol_debugtext.h +++ b/util/sokol_debugtext.h @@ -282,6 +282,11 @@ sdtx_set_context(SDTX_DEFAULT_CONTEXT) + Alternatively, use the function sdtx_default_context() to get the default + context handle: + + sdtx_set_context(sdtx_default_context()); + To destroy a context, call: sdtx_destroy_context(ctx) @@ -538,6 +543,7 @@ SOKOL_DEBUGTEXT_API_DECL sdtx_context sdtx_make_context(const sdtx_context_desc_ SOKOL_DEBUGTEXT_API_DECL void sdtx_destroy_context(sdtx_context ctx); SOKOL_DEBUGTEXT_API_DECL void sdtx_set_context(sdtx_context ctx); SOKOL_DEBUGTEXT_API_DECL sdtx_context sdtx_get_context(void); +SOKOL_DEBUGTEXT_API_DECL sdtx_context sdtx_default_context(void); /* draw and rewind the current context */ SOKOL_DEBUGTEXT_API_DECL void sdtx_draw(void); @@ -3977,6 +3983,10 @@ SOKOL_API_IMPL sdtx_context sdtx_get_context(void) { return _sdtx.cur_ctx_id; } +SOKOL_API_IMPL sdtx_context sdtx_default_context(void) { + return SDTX_DEFAULT_CONTEXT; +} + SOKOL_API_IMPL void sdtx_font(int font_index) { SOKOL_ASSERT(_SDTX_INIT_COOKIE == _sdtx.init_cookie); SOKOL_ASSERT((font_index >= 0) && (font_index < SDTX_MAX_FONTS)); |