townengine/src/twn_stb.c

25 lines
777 B
C
Raw Normal View History

/* single compilation unit for every stb implementation */
#define STB_DS_IMPLEMENTATION
#define STBDS_ASSERT SDL_assert
#define STBDS_REALLOC(context,ptr,size) ((void)(context), SDL_realloc(ptr, size))
#define STBDS_FREE(context,ptr) ((void)(context), SDL_free(ptr))
#include <stb_ds.h>
#define STB_RECT_PACK_IMPLEMENTATION
#define STBRP_SORT SDL_qsort
#define STBRP_ASSERT SDL_assert
#include <stb_rect_pack.h>
#define STB_TRUETYPE_IMPLEMENTATION
#define STBTT_malloc(x,u) ((void)(u), SDL_malloc(x))
#define STBTT_free(x,u) ((void)(u), SDL_free(x))
#define STBTT_assert(x) SDL_assert(x)
#define STBTT_strlen(x) SDL_strlen(x)
#define STBTT_memcpy SDL_memcpy
#define STBTT_memset SDL_memset
#include <stb_truetype.h>
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>