Skip to content

Commit

Permalink
Update documentation around disabling STB_*_IMPLEMENTATION defines
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLoach committed Oct 17, 2023
1 parent deb0fc6 commit 080c673
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
16 changes: 12 additions & 4 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -6091,14 +6091,22 @@ NK_LIB void nk_property(struct nk_context *ctx, const char *name, struct nk_prop
#ifdef NK_INCLUDE_FONT_BAKING

/**
* NK_FONT_BAKING_SKIP_STB_IMPLEMENTATION
* @def NK_NO_STB_RECT_PACK_IMPLEMENTATION
*
* Allows skipping defining STB_RECT_PACK_IMPLEMENTATION and STB_TRUETYPE_IMPLEMENTATION.
* When defined, will avoid enabling STB_RECT_PACK_IMPLEMENTATION for when stb_rect_pack.h is already implemented elsewhere.
*/
#ifndef NK_FONT_BAKING_SKIP_STB_IMPLEMENTATION
#ifndef NK_NO_STB_RECT_PACK_IMPLEMENTATION
#define STB_RECT_PACK_IMPLEMENTATION
#endif /* NK_NO_STB_RECT_PACK_IMPLEMENTATION */

/**
* @def NK_NO_STB_TRUETYPE_IMPLEMENTATION
*
* When defined, will avoid enabling STB_TRUETYPE_IMPLEMENTATION for when stb_truetype.h is already implemented elsewhere.
*/
#ifndef NK_NO_STB_TRUETYPE_IMPLEMENTATION
#define STB_TRUETYPE_IMPLEMENTATION
#endif /* NK_FONT_BAKING_SKIP_STB_IMPLEMENTATION */
#endif /* NK_NO_STB_TRUETYPE_IMPLEMENTATION */

/* Allow consumer to define own STBTT_malloc/STBTT_free, and use the font atlas' allocator otherwise */
#ifndef STBTT_malloc
Expand Down
16 changes: 12 additions & 4 deletions src/nuklear_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,22 @@ NK_LIB void nk_property(struct nk_context *ctx, const char *name, struct nk_prop
#ifdef NK_INCLUDE_FONT_BAKING

/**
* NK_FONT_BAKING_SKIP_STB_IMPLEMENTATION
* @def NK_NO_STB_RECT_PACK_IMPLEMENTATION
*
* Allows skipping defining STB_RECT_PACK_IMPLEMENTATION and STB_TRUETYPE_IMPLEMENTATION.
* When defined, will avoid enabling STB_RECT_PACK_IMPLEMENTATION for when stb_rect_pack.h is already implemented elsewhere.
*/
#ifndef NK_FONT_BAKING_SKIP_STB_IMPLEMENTATION
#ifndef NK_NO_STB_RECT_PACK_IMPLEMENTATION
#define STB_RECT_PACK_IMPLEMENTATION
#endif /* NK_NO_STB_RECT_PACK_IMPLEMENTATION */

/**
* @def NK_NO_STB_TRUETYPE_IMPLEMENTATION
*
* When defined, will avoid enabling STB_TRUETYPE_IMPLEMENTATION for when stb_truetype.h is already implemented elsewhere.
*/
#ifndef NK_NO_STB_TRUETYPE_IMPLEMENTATION
#define STB_TRUETYPE_IMPLEMENTATION
#endif /* NK_FONT_BAKING_SKIP_STB_IMPLEMENTATION */
#endif /* NK_NO_STB_TRUETYPE_IMPLEMENTATION */

/* Allow consumer to define own STBTT_malloc/STBTT_free, and use the font atlas' allocator otherwise */
#ifndef STBTT_malloc
Expand Down

0 comments on commit 080c673

Please sign in to comment.