diff options
| author | Borislav Stanimirov <b.stanimirov@abv.bg> | 2020-11-19 14:07:38 +0200 |
|---|---|---|
| committer | Borislav Stanimirov <b.stanimirov@abv.bg> | 2020-11-19 14:20:09 +0200 |
| commit | 426c460cc9d02f24a5d25bc8db3564d7a575eeab (patch) | |
| tree | 152b0dd42082436acf0f7b8f2f5c2bb5b2f85458 /util | |
| parent | 18dd8787124118a19c7b7cf23149c4145dd03590 (diff) | |
Auto-generated distinct macros per lib. Resolves #428
Diffstat (limited to 'util')
| -rw-r--r-- | util/sokol_debugtext.h | 94 | ||||
| -rw-r--r-- | util/sokol_fontstash.h | 22 | ||||
| -rw-r--r-- | util/sokol_gfx_imgui.h | 54 | ||||
| -rw-r--r-- | util/sokol_gl.h | 164 | ||||
| -rw-r--r-- | util/sokol_imgui.h | 26 | ||||
| -rw-r--r-- | util/sokol_memtrack.h | 16 | ||||
| -rw-r--r-- | util/sokol_shape.h | 68 |
7 files changed, 236 insertions, 208 deletions
diff --git a/util/sokol_debugtext.h b/util/sokol_debugtext.h index 90c15cb5..4656b53c 100644 --- a/util/sokol_debugtext.h +++ b/util/sokol_debugtext.h @@ -26,7 +26,7 @@ SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) SOKOL_MALLOC(s) - your own malloc function (default: malloc(s)) SOKOL_FREE(p) - your own free function (default: free(p)) - SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_DEBUGTEXT_API_DECL - public function declaration prefix (default: extern) SOKOL_API_IMPL - public function implementation prefix (default: -) SOKOL_LOG(msg) - your own logging function (default: puts(msg)) SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) @@ -36,7 +36,7 @@ SOKOL_DLL - On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + On Windows, SOKOL_DLL will define SOKOL_DEBUGTEXT_API_DECL as __declspec(dllexport) or __declspec(dllimport) as needed. Include the following headers before including sokol_debugtext.h: @@ -392,13 +392,17 @@ #error "Please include sokol_gfx.h before sokol_debugtext.h" #endif -#ifndef SOKOL_API_DECL +#if defined(SOKOL_API_DECL) && !defined(SOKOL_DEBUGTEXT_API_DECL) + #define SOKOL_DEBUGTEXT_API_DECL SOKOL_API_DECL +#endif + +#ifndef SOKOL_DEBUGTEXT_API_DECL #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) -#define SOKOL_API_DECL __declspec(dllexport) +#define SOKOL_DEBUGTEXT_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) -#define SOKOL_API_DECL __declspec(dllimport) +#define SOKOL_DEBUGTEXT_API_DECL __declspec(dllimport) #else -#define SOKOL_API_DECL extern +#define SOKOL_DEBUGTEXT_API_DECL extern #endif #endif @@ -490,58 +494,58 @@ typedef struct sdtx_desc_t { } sdtx_desc_t; /* initialization/shutdown */ -SOKOL_API_DECL void sdtx_setup(const sdtx_desc_t* desc); -SOKOL_API_DECL void sdtx_shutdown(void); +SOKOL_DEBUGTEXT_API_DECL void sdtx_setup(const sdtx_desc_t* desc); +SOKOL_DEBUGTEXT_API_DECL void sdtx_shutdown(void); /* builtin font data (use to populate sdtx_desc.font[]) */ -SOKOL_API_DECL sdtx_font_desc_t sdtx_font_kc853(void); -SOKOL_API_DECL sdtx_font_desc_t sdtx_font_kc854(void); -SOKOL_API_DECL sdtx_font_desc_t sdtx_font_z1013(void); -SOKOL_API_DECL sdtx_font_desc_t sdtx_font_cpc(void); -SOKOL_API_DECL sdtx_font_desc_t sdtx_font_c64(void); -SOKOL_API_DECL sdtx_font_desc_t sdtx_font_oric(void); +SOKOL_DEBUGTEXT_API_DECL sdtx_font_desc_t sdtx_font_kc853(void); +SOKOL_DEBUGTEXT_API_DECL sdtx_font_desc_t sdtx_font_kc854(void); +SOKOL_DEBUGTEXT_API_DECL sdtx_font_desc_t sdtx_font_z1013(void); +SOKOL_DEBUGTEXT_API_DECL sdtx_font_desc_t sdtx_font_cpc(void); +SOKOL_DEBUGTEXT_API_DECL sdtx_font_desc_t sdtx_font_c64(void); +SOKOL_DEBUGTEXT_API_DECL sdtx_font_desc_t sdtx_font_oric(void); /* context functions */ -SOKOL_API_DECL sdtx_context sdtx_make_context(const sdtx_context_desc_t* desc); -SOKOL_API_DECL void sdtx_destroy_context(sdtx_context ctx); -SOKOL_API_DECL void sdtx_set_context(sdtx_context ctx); -SOKOL_API_DECL sdtx_context sdtx_get_context(void); +SOKOL_DEBUGTEXT_API_DECL sdtx_context sdtx_make_context(const sdtx_context_desc_t* 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); /* draw and rewind the current context */ -SOKOL_API_DECL void sdtx_draw(void); +SOKOL_DEBUGTEXT_API_DECL void sdtx_draw(void); /* switch to a different font */ -SOKOL_API_DECL void sdtx_font(int font_index); +SOKOL_DEBUGTEXT_API_DECL void sdtx_font(int font_index); /* set a new virtual canvas size in screen pixels */ -SOKOL_API_DECL void sdtx_canvas(float w, float h); +SOKOL_DEBUGTEXT_API_DECL void sdtx_canvas(float w, float h); /* set a new origin in character grid coordinates */ -SOKOL_API_DECL void sdtx_origin(float x, float y); +SOKOL_DEBUGTEXT_API_DECL void sdtx_origin(float x, float y); /* cursor movement functions (relative to origin in character grid coordinates) */ -SOKOL_API_DECL void sdtx_home(void); -SOKOL_API_DECL void sdtx_pos(float x, float y); -SOKOL_API_DECL void sdtx_pos_x(float x); -SOKOL_API_DECL void sdtx_pos_y(float y); -SOKOL_API_DECL void sdtx_move(float dx, float dy); -SOKOL_API_DECL void sdtx_move_x(float dx); -SOKOL_API_DECL void sdtx_move_y(float dy); -SOKOL_API_DECL void sdtx_crlf(void); +SOKOL_DEBUGTEXT_API_DECL void sdtx_home(void); +SOKOL_DEBUGTEXT_API_DECL void sdtx_pos(float x, float y); +SOKOL_DEBUGTEXT_API_DECL void sdtx_pos_x(float x); +SOKOL_DEBUGTEXT_API_DECL void sdtx_pos_y(float y); +SOKOL_DEBUGTEXT_API_DECL void sdtx_move(float dx, float dy); +SOKOL_DEBUGTEXT_API_DECL void sdtx_move_x(float dx); +SOKOL_DEBUGTEXT_API_DECL void sdtx_move_y(float dy); +SOKOL_DEBUGTEXT_API_DECL void sdtx_crlf(void); /* set the current text color */ -SOKOL_API_DECL void sdtx_color3b(uint8_t r, uint8_t g, uint8_t b); // RGB 0..255, A=255 -SOKOL_API_DECL void sdtx_color3f(float r, float g, float b); // RGB 0.0f..1.0f, A=1.0f -SOKOL_API_DECL void sdtx_color4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a); // RGBA 0..255 -SOKOL_API_DECL void sdtx_color4f(float r, float g, float b, float a); // RGBA 0.0f..1.0f -SOKOL_API_DECL void sdtx_color1i(uint32_t rgba); // ABGR 0xAABBGGRR +SOKOL_DEBUGTEXT_API_DECL void sdtx_color3b(uint8_t r, uint8_t g, uint8_t b); // RGB 0..255, A=255 +SOKOL_DEBUGTEXT_API_DECL void sdtx_color3f(float r, float g, float b); // RGB 0.0f..1.0f, A=1.0f +SOKOL_DEBUGTEXT_API_DECL void sdtx_color4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a); // RGBA 0..255 +SOKOL_DEBUGTEXT_API_DECL void sdtx_color4f(float r, float g, float b, float a); // RGBA 0.0f..1.0f +SOKOL_DEBUGTEXT_API_DECL void sdtx_color1i(uint32_t rgba); // ABGR 0xAABBGGRR /* text rendering */ -SOKOL_API_DECL void sdtx_putc(char c); -SOKOL_API_DECL void sdtx_puts(const char* str); // does NOT append newline! -SOKOL_API_DECL void sdtx_putr(const char* str, int len); // 'put range', also stops at zero-char -SOKOL_API_DECL int sdtx_printf(const char* fmt, ...) SOKOL_DEBUGTEXT_PRINTF_ATTR; -SOKOL_API_DECL int sdtx_vprintf(const char* fmt, va_list args); +SOKOL_DEBUGTEXT_API_DECL void sdtx_putc(char c); +SOKOL_DEBUGTEXT_API_DECL void sdtx_puts(const char* str); // does NOT append newline! +SOKOL_DEBUGTEXT_API_DECL void sdtx_putr(const char* str, int len); // 'put range', also stops at zero-char +SOKOL_DEBUGTEXT_API_DECL int sdtx_printf(const char* fmt, ...) SOKOL_DEBUGTEXT_PRINTF_ATTR; +SOKOL_DEBUGTEXT_API_DECL int sdtx_vprintf(const char* fmt, va_list args); #ifdef __cplusplus } /* extern "C" */ @@ -4089,7 +4093,7 @@ SOKOL_API_IMPL void sdtx_color1i(uint32_t rgba) { } } -SOKOL_API_DECL void sdtx_putc(char chr) { +SOKOL_DEBUGTEXT_API_DECL void sdtx_putc(char chr) { SOKOL_ASSERT(_SDTX_INIT_COOKIE == _sdtx.init_cookie); _sdtx_context_t* ctx = _sdtx.cur_ctx; if (ctx) { @@ -4097,7 +4101,7 @@ SOKOL_API_DECL void sdtx_putc(char chr) { } } -SOKOL_API_DECL void sdtx_puts(const char* str) { +SOKOL_DEBUGTEXT_API_DECL void sdtx_puts(const char* str) { SOKOL_ASSERT(_SDTX_INIT_COOKIE == _sdtx.init_cookie); _sdtx_context_t* ctx = _sdtx.cur_ctx; if (ctx) { @@ -4108,7 +4112,7 @@ SOKOL_API_DECL void sdtx_puts(const char* str) { } } -SOKOL_API_DECL void sdtx_putr(const char* str, int len) { +SOKOL_DEBUGTEXT_API_DECL void sdtx_putr(const char* str, int len) { SOKOL_ASSERT(_SDTX_INIT_COOKIE == _sdtx.init_cookie); _sdtx_context_t* ctx = _sdtx.cur_ctx; if (ctx) { @@ -4122,7 +4126,7 @@ SOKOL_API_DECL void sdtx_putr(const char* str, int len) { } } -SOKOL_API_DECL int sdtx_vprintf(const char* fmt, va_list args) { +SOKOL_DEBUGTEXT_API_DECL int sdtx_vprintf(const char* fmt, va_list args) { SOKOL_ASSERT(_SDTX_INIT_COOKIE == _sdtx.init_cookie); SOKOL_ASSERT(_sdtx.fmt_buf && (_sdtx.fmt_buf_size >= 2)); int res = SOKOL_VSNPRINTF(_sdtx.fmt_buf, _sdtx.fmt_buf_size, fmt, args); @@ -4132,7 +4136,7 @@ SOKOL_API_DECL int sdtx_vprintf(const char* fmt, va_list args) { return res; } -SOKOL_API_DECL int sdtx_printf(const char* fmt, ...) { +SOKOL_DEBUGTEXT_API_DECL int sdtx_printf(const char* fmt, ...) { SOKOL_ASSERT(_SDTX_INIT_COOKIE == _sdtx.init_cookie); SOKOL_ASSERT(_sdtx.fmt_buf && (_sdtx.fmt_buf_size >= 2)); va_list args; diff --git a/util/sokol_fontstash.h b/util/sokol_fontstash.h index 81b35a97..e286f9cc 100644 --- a/util/sokol_fontstash.h +++ b/util/sokol_fontstash.h @@ -27,7 +27,7 @@ SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) SOKOL_MALLOC(s) - your own malloc function (default: malloc(s)) SOKOL_FREE(p) - your own free function (default: free(p)) - SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_FONTSTASH_API_DECL - public function declaration prefix (default: extern) SOKOL_API_IMPL - public function implementation prefix (default: -) SOKOL_LOG(msg) - your own logging function (default: puts(msg)) SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) @@ -159,23 +159,27 @@ #error "Please include sokol_gfx.h before sokol_fontstash.h" #endif -#ifndef SOKOL_API_DECL +#if defined(SOKOL_API_DECL) && !defined(SOKOL_FONTSTASH_API_DECL) + #define SOKOL_FONTSTASH_API_DECL SOKOL_API_DECL +#endif + +#ifndef SOKOL_FONTSTASH_API_DECL #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) -#define SOKOL_API_DECL __declspec(dllexport) +#define SOKOL_FONTSTASH_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) -#define SOKOL_API_DECL __declspec(dllimport) +#define SOKOL_FONTSTASH_API_DECL __declspec(dllimport) #else -#define SOKOL_API_DECL extern +#define SOKOL_FONTSTASH_API_DECL extern #endif #endif #ifdef __cplusplus extern "C" { #endif -SOKOL_API_DECL FONScontext* sfons_create(int width, int height, int flags); -SOKOL_API_DECL void sfons_destroy(FONScontext* ctx); -SOKOL_API_DECL void sfons_flush(FONScontext* ctx); -SOKOL_API_DECL uint32_t sfons_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_FONTSTASH_API_DECL FONScontext* sfons_create(int width, int height, int flags); +SOKOL_FONTSTASH_API_DECL void sfons_destroy(FONScontext* ctx); +SOKOL_FONTSTASH_API_DECL void sfons_flush(FONScontext* ctx); +SOKOL_FONTSTASH_API_DECL uint32_t sfons_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a); #ifdef __cplusplus } /* extern "C" */ diff --git a/util/sokol_gfx_imgui.h b/util/sokol_gfx_imgui.h index dd1da8bc..108fbeaf 100644 --- a/util/sokol_gfx_imgui.h +++ b/util/sokol_gfx_imgui.h @@ -44,7 +44,7 @@ default: SOKOL_ASSERT(false) SOKOL_MALLOC(s) -- your own memory allocation function, default: malloc(s) SOKOL_FREE(p) -- your own memory free function, default: free(p) - SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_GFX_IMGUI_API_DECL - public function declaration prefix (default: extern) SOKOL_API_IMPL - public function implementation prefix (default: -) If sokol_gfx_imgui.h is compiled as a DLL, define the following before @@ -52,7 +52,7 @@ SOKOL_DLL - On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + On Windows, SOKOL_DLL will define SOKOL_GFX_IMGUI_API_DECL as __declspec(dllexport) or __declspec(dllimport) as needed. STEP BY STEP: @@ -165,13 +165,17 @@ #error "Please include sokol_gfx.h before sokol_gfx_imgui.h" #endif -#ifndef SOKOL_API_DECL +#if defined(SOKOL_API_DECL) && !defined(SOKOL_GFX_IMGUI_API_DECL) + #define SOKOL_GFX_IMGUI_API_DECL SOKOL_API_DECL +#endif + +#ifndef SOKOL_GFX_IMGUI_API_DECL #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) -#define SOKOL_API_DECL __declspec(dllexport) +#define SOKOL_GFX_IMGUI_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) -#define SOKOL_API_DECL __declspec(dllimport) +#define SOKOL_GFX_IMGUI_API_DECL __declspec(dllimport) #else -#define SOKOL_API_DECL extern +#define SOKOL_GFX_IMGUI_API_DECL extern #endif #endif @@ -563,25 +567,25 @@ typedef struct { sg_trace_hooks hooks; } sg_imgui_t; -SOKOL_API_DECL void sg_imgui_init(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_discard(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw(sg_imgui_t* ctx); - -SOKOL_API_DECL void sg_imgui_draw_buffers_content(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_images_content(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_shaders_content(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_pipelines_content(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_passes_content(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_capture_content(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_capabilities_content(sg_imgui_t* ctx); - -SOKOL_API_DECL void sg_imgui_draw_buffers_window(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_images_window(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_shaders_window(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_pipelines_window(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_passes_window(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_capture_window(sg_imgui_t* ctx); -SOKOL_API_DECL void sg_imgui_draw_capabilities_window(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_init(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_discard(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw(sg_imgui_t* ctx); + +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_buffers_content(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_images_content(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_shaders_content(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_pipelines_content(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_passes_content(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_capture_content(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_capabilities_content(sg_imgui_t* ctx); + +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_buffers_window(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_images_window(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_shaders_window(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_pipelines_window(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_passes_window(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_capture_window(sg_imgui_t* ctx); +SOKOL_GFX_IMGUI_API_DECL void sg_imgui_draw_capabilities_window(sg_imgui_t* ctx); #if defined(__cplusplus) } /* extern "C" */ diff --git a/util/sokol_gl.h b/util/sokol_gl.h index e7b7b553..e548686e 100644 --- a/util/sokol_gl.h +++ b/util/sokol_gl.h @@ -25,7 +25,7 @@ SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) SOKOL_MALLOC(s) - your own malloc function (default: malloc(s)) SOKOL_FREE(p) - your own free function (default: free(p)) - SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_GL_API_DECL - public function declaration prefix (default: extern) SOKOL_API_IMPL - public function implementation prefix (default: -) SOKOL_LOG(msg) - your own logging function (default: puts(msg)) SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) @@ -35,7 +35,7 @@ SOKOL_DLL - On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + On Windows, SOKOL_DLL will define SOKOL_GL_API_DECL as __declspec(dllexport) or __declspec(dllimport) as needed. Include the following headers before including sokol_gl.h: @@ -445,13 +445,17 @@ #error "Please include sokol_gfx.h before sokol_gl.h" #endif -#ifndef SOKOL_API_DECL +#if defined(SOKOL_API_DECL) && !defined(SOKOL_GL_API_DECL) + #define SOKOL_GL_API_DECL SOKOL_API_DECL +#endif + +#ifndef SOKOL_GL_API_DECL #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) -#define SOKOL_API_DECL __declspec(dllexport) +#define SOKOL_GL_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) -#define SOKOL_API_DECL __declspec(dllimport) +#define SOKOL_GL_API_DECL __declspec(dllimport) #else -#define SOKOL_API_DECL extern +#define SOKOL_GL_API_DECL extern #endif #endif @@ -488,92 +492,92 @@ typedef struct sgl_desc_t { } sgl_desc_t; /* setup/shutdown/misc */ -SOKOL_API_DECL void sgl_setup(const sgl_desc_t* desc); -SOKOL_API_DECL void sgl_shutdown(void); -SOKOL_API_DECL sgl_error_t sgl_error(void); -SOKOL_API_DECL void sgl_defaults(void); -SOKOL_API_DECL float sgl_rad(float deg); -SOKOL_API_DECL float sgl_deg(float rad); +SOKOL_GL_API_DECL void sgl_setup(const sgl_desc_t* desc); +SOKOL_GL_API_DECL void sgl_shutdown(void); +SOKOL_GL_API_DECL sgl_error_t sgl_error(void); +SOKOL_GL_API_DECL void sgl_defaults(void); +SOKOL_GL_API_DECL float sgl_rad(float deg); +SOKOL_GL_API_DECL float sgl_deg(float rad); /* create and destroy pipeline objects */ -SOKOL_API_DECL sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc); -SOKOL_API_DECL void sgl_destroy_pipeline(sgl_pipeline pip); +SOKOL_GL_API_DECL sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc); +SOKOL_GL_API_DECL void sgl_destroy_pipeline(sgl_pipeline pip); /* render state functions */ -SOKOL_API_DECL void sgl_viewport(int x, int y, int w, int h, bool origin_top_left); -SOKOL_API_DECL void sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left); -SOKOL_API_DECL void sgl_enable_texture(void); -SOKOL_API_DECL void sgl_disable_texture(void); -SOKOL_API_DECL void sgl_texture(sg_image img); +SOKOL_GL_API_DECL void sgl_viewport(int x, int y, int w, int h, bool origin_top_left); +SOKOL_GL_API_DECL void sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left); +SOKOL_GL_API_DECL void sgl_enable_texture(void); +SOKOL_GL_API_DECL void sgl_disable_texture(void); +SOKOL_GL_API_DECL void sgl_texture(sg_image img); /* pipeline stack functions */ -SOKOL_API_DECL void sgl_default_pipeline(void); -SOKOL_API_DECL void sgl_load_pipeline(sgl_pipeline pip); -SOKOL_API_DECL void sgl_push_pipeline(void); -SOKOL_API_DECL void sgl_pop_pipeline(void); +SOKOL_GL_API_DECL void sgl_default_pipeline(void); +SOKOL_GL_API_DECL void sgl_load_pipeline(sgl_pipeline pip); +SOKOL_GL_API_DECL void sgl_push_pipeline(void); +SOKOL_GL_API_DECL void sgl_pop_pipeline(void); /* matrix stack functions */ -SOKOL_API_DECL void sgl_matrix_mode_modelview(void); -SOKOL_API_DECL void sgl_matrix_mode_projection(void); -SOKOL_API_DECL void sgl_matrix_mode_texture(void); -SOKOL_API_DECL void sgl_load_identity(void); -SOKOL_API_DECL void sgl_load_matrix(const float m[16]); -SOKOL_API_DECL void sgl_load_transpose_matrix(const float m[16]); -SOKOL_API_DECL void sgl_mult_matrix(const float m[16]); -SOKOL_API_DECL void sgl_mult_transpose_matrix(const float m[16]); -SOKOL_API_DECL void sgl_rotate(float angle_rad, float x, float y, float z); -SOKOL_API_DECL void sgl_scale(float x, float y, float z); -SOKOL_API_DECL void sgl_translate(float x, float y, float z); -SOKOL_API_DECL void sgl_frustum(float l, float r, float b, float t, float n, float f); -SOKOL_API_DECL void sgl_ortho(float l, float r, float b, float t, float n, float f); -SOKOL_API_DECL void sgl_perspective(float fov_y, float aspect, float z_near, float z_far); -SOKOL_API_DECL void sgl_lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z); -SOKOL_API_DECL void sgl_push_matrix(void); -SOKOL_API_DECL void sgl_pop_matrix(void); +SOKOL_GL_API_DECL void sgl_matrix_mode_modelview(void); +SOKOL_GL_API_DECL void sgl_matrix_mode_projection(void); +SOKOL_GL_API_DECL void sgl_matrix_mode_texture(void); +SOKOL_GL_API_DECL void sgl_load_identity(void); +SOKOL_GL_API_DECL void sgl_load_matrix(const float m[16]); +SOKOL_GL_API_DECL void sgl_load_transpose_matrix(const float m[16]); +SOKOL_GL_API_DECL void sgl_mult_matrix(const float m[16]); +SOKOL_GL_API_DECL void sgl_mult_transpose_matrix(const float m[16]); +SOKOL_GL_API_DECL void sgl_rotate(float angle_rad, float x, float y, float z); +SOKOL_GL_API_DECL void sgl_scale(float x, float y, float z); +SOKOL_GL_API_DECL void sgl_translate(float x, float y, float z); +SOKOL_GL_API_DECL void sgl_frustum(float l, float r, float b, float t, float n, float f); +SOKOL_GL_API_DECL void sgl_ortho(float l, float r, float b, float t, float n, float f); +SOKOL_GL_API_DECL void sgl_perspective(float fov_y, float aspect, float z_near, float z_far); +SOKOL_GL_API_DECL void sgl_lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z); +SOKOL_GL_API_DECL void sgl_push_matrix(void); +SOKOL_GL_API_DECL void sgl_pop_matrix(void); /* these functions only set the internal 'current texcoord / color' (valid inside or outside begin/end) */ -SOKOL_API_DECL void sgl_t2f(float u, float v); -SOKOL_API_DECL void sgl_c3f(float r, float g, float b); -SOKOL_API_DECL void sgl_c4f(float r, float g, float b, float a); -SOKOL_API_DECL void sgl_c3b(uint8_t r, uint8_t g, uint8_t b); -SOKOL_API_DECL void sgl_c4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a); -SOKOL_API_DECL void sgl_c1i(uint32_t rgba); +SOKOL_GL_API_DECL void sgl_t2f(float u, float v); +SOKOL_GL_API_DECL void sgl_c3f(float r, float g, float b); +SOKOL_GL_API_DECL void sgl_c4f(float r, float g, float b, float a); +SOKOL_GL_API_DECL void sgl_c3b(uint8_t r, uint8_t g, uint8_t b); +SOKOL_GL_API_DECL void sgl_c4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_GL_API_DECL void sgl_c1i(uint32_t rgba); /* define primitives, each begin/end is one draw command */ -SOKOL_API_DECL void sgl_begin_points(void); -SOKOL_API_DECL void sgl_begin_lines(void); -SOKOL_API_DECL void sgl_begin_line_strip(void); -SOKOL_API_DECL void sgl_begin_triangles(void); -SOKOL_API_DECL void sgl_begin_triangle_strip(void); -SOKOL_API_DECL void sgl_begin_quads(void); -SOKOL_API_DECL void sgl_v2f(float x, float y); -SOKOL_API_DECL void sgl_v3f(float x, float y, float z); -SOKOL_API_DECL void sgl_v2f_t2f(float x, float y, float u, float v); -SOKOL_API_DECL void sgl_v3f_t2f(float x, float y, float z, float u, float v); -SOKOL_API_DECL void sgl_v2f_c3f(float x, float y, float r, float g, float b); -SOKOL_API_DECL void sgl_v2f_c3b(float x, float y, uint8_t r, uint8_t g, uint8_t b); -SOKOL_API_DECL void sgl_v2f_c4f(float x, float y, float r, float g, float b, float a); -SOKOL_API_DECL void sgl_v2f_c4b(float x, float y, uint8_t r, uint8_t g, uint8_t b, uint8_t a); -SOKOL_API_DECL void sgl_v2f_c1i(float x, float y, uint32_t rgba); -SOKOL_API_DECL void sgl_v3f_c3f(float x, float y, float z, float r, float g, float b); -SOKOL_API_DECL void sgl_v3f_c3b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b); -SOKOL_API_DECL void sgl_v3f_c4f(float x, float y, float z, float r, float g, float b, float a); -SOKOL_API_DECL void sgl_v3f_c4b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b, uint8_t a); -SOKOL_API_DECL void sgl_v3f_c1i(float x, float y, float z, uint32_t rgba); -SOKOL_API_DECL void sgl_v2f_t2f_c3f(float x, float y, float u, float v, float r, float g, float b); -SOKOL_API_DECL void sgl_v2f_t2f_c3b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b); -SOKOL_API_DECL void sgl_v2f_t2f_c4f(float x, float y, float u, float v, float r, float g, float b, float a); -SOKOL_API_DECL void sgl_v2f_t2f_c4b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a); -SOKOL_API_DECL void sgl_v2f_t2f_c1i(float x, float y, float u, float v, uint32_t rgba); -SOKOL_API_DECL void sgl_v3f_t2f_c3f(float x, float y, float z, float u, float v, float r, float g, float b); -SOKOL_API_DECL void sgl_v3f_t2f_c3b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b); -SOKOL_API_DECL void sgl_v3f_t2f_c4f(float x, float y, float z, float u, float v, float r, float g, float b, float a); -SOKOL_API_DECL void sgl_v3f_t2f_c4b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a); -SOKOL_API_DECL void sgl_v3f_t2f_c1i(float x, float y, float z, float u, float v, uint32_t rgba); -SOKOL_API_DECL void sgl_end(void); +SOKOL_GL_API_DECL void sgl_begin_points(void); +SOKOL_GL_API_DECL void sgl_begin_lines(void); +SOKOL_GL_API_DECL void sgl_begin_line_strip(void); +SOKOL_GL_API_DECL void sgl_begin_triangles(void); +SOKOL_GL_API_DECL void sgl_begin_triangle_strip(void); +SOKOL_GL_API_DECL void sgl_begin_quads(void); +SOKOL_GL_API_DECL void sgl_v2f(float x, float y); +SOKOL_GL_API_DECL void sgl_v3f(float x, float y, float z); +SOKOL_GL_API_DECL void sgl_v2f_t2f(float x, float y, float u, float v); +SOKOL_GL_API_DECL void sgl_v3f_t2f(float x, float y, float z, float u, float v); +SOKOL_GL_API_DECL void sgl_v2f_c3f(float x, float y, float r, float g, float b); +SOKOL_GL_API_DECL void sgl_v2f_c3b(float x, float y, uint8_t r, uint8_t g, uint8_t b); +SOKOL_GL_API_DECL void sgl_v2f_c4f(float x, float y, float r, float g, float b, float a); +SOKOL_GL_API_DECL void sgl_v2f_c4b(float x, float y, uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_GL_API_DECL void sgl_v2f_c1i(float x, float y, uint32_t rgba); +SOKOL_GL_API_DECL void sgl_v3f_c3f(float x, float y, float z, float r, float g, float b); +SOKOL_GL_API_DECL void sgl_v3f_c3b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b); +SOKOL_GL_API_DECL void sgl_v3f_c4f(float x, float y, float z, float r, float g, float b, float a); +SOKOL_GL_API_DECL void sgl_v3f_c4b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_GL_API_DECL void sgl_v3f_c1i(float x, float y, float z, uint32_t rgba); +SOKOL_GL_API_DECL void sgl_v2f_t2f_c3f(float x, float y, float u, float v, float r, float g, float b); +SOKOL_GL_API_DECL void sgl_v2f_t2f_c3b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b); +SOKOL_GL_API_DECL void sgl_v2f_t2f_c4f(float x, float y, float u, float v, float r, float g, float b, float a); +SOKOL_GL_API_DECL void sgl_v2f_t2f_c4b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_GL_API_DECL void sgl_v2f_t2f_c1i(float x, float y, float u, float v, uint32_t rgba); +SOKOL_GL_API_DECL void sgl_v3f_t2f_c3f(float x, float y, float z, float u, float v, float r, float g, float b); +SOKOL_GL_API_DECL void sgl_v3f_t2f_c3b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b); +SOKOL_GL_API_DECL void sgl_v3f_t2f_c4f(float x, float y, float z, float u, float v, float r, float g, float b, float a); +SOKOL_GL_API_DECL void sgl_v3f_t2f_c4b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_GL_API_DECL void sgl_v3f_t2f_c1i(float x, float y, float z, float u, float v, uint32_t rgba); +SOKOL_GL_API_DECL void sgl_end(void); /* render everything */ -SOKOL_API_DECL void sgl_draw(void); +SOKOL_GL_API_DECL void sgl_draw(void); #ifdef __cplusplus } /* extern "C" */ @@ -3193,7 +3197,7 @@ SOKOL_API_IMPL void sgl_lookat(float eye_x, float eye_y, float eye_z, float cent _sgl_lookat(_sgl_matrix(), eye_x, eye_y, eye_z, center_x, center_y, center_z, up_x, up_y, up_z); } -SOKOL_API_DECL void sgl_push_matrix(void) { +SOKOL_GL_API_DECL void sgl_push_matrix(void) { SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); SOKOL_ASSERT((_sgl.cur_matrix_mode >= 0) && (_sgl.cur_matrix_mode < SGL_NUM_MATRIXMODES)); _sgl.matrix_dirty = true; @@ -3208,7 +3212,7 @@ SOKOL_API_DECL void sgl_push_matrix(void) { } } -SOKOL_API_DECL void sgl_pop_matrix(void) { +SOKOL_GL_API_DECL void sgl_pop_matrix(void) { SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); SOKOL_ASSERT((_sgl.cur_matrix_mode >= 0) && (_sgl.cur_matrix_mode < SGL_NUM_MATRIXMODES)); _sgl.matrix_dirty = true; diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h index cd83e9ef..178f396b 100644 --- a/util/sokol_imgui.h +++ b/util/sokol_imgui.h @@ -39,7 +39,7 @@ to override defaults: SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) - SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_IMGUI_API_DECL- public function declaration prefix (default: extern) SOKOL_API_IMPL - public function implementation prefix (default: -) If sokol_imgui.h is compiled as a DLL, define the following before @@ -47,7 +47,7 @@ SOKOL_DLL - On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + On Windows, SOKOL_DLL will define SOKOL_IMGUI_API_DECL as __declspec(dllexport) or __declspec(dllimport) as needed. Include the following headers before sokol_imgui.h (both before including @@ -204,13 +204,17 @@ #error "Please include sokol_app.h before sokol_imgui.h" #endif -#ifndef SOKOL_API_DECL +#if defined(SOKOL_API_DECL) && !defined(SOKOL_IMGUI_API_DECL) + #define SOKOL_IMGUI_API_DECL SOKOL_API_DECL +#endif + +#ifndef SOKOL_IMGUI_API_DECL #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) -#define SOKOL_API_DECL __declspec(dllexport) +#define SOKOL_IMGUI_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) -#define SOKOL_API_DECL __declspec(dllimport) +#define SOKOL_IMGUI_API_DECL __declspec(dllimport) #else -#define SOKOL_API_DECL extern +#define SOKOL_IMGUI_API_DECL extern #endif #endif @@ -229,13 +233,13 @@ typedef struct simgui_desc_t { bool disable_hotkeys; /* don't let ImGui handle Ctrl-A,C,V,X,Y,Z */ } simgui_desc_t; -SOKOL_API_DECL void simgui_setup(const simgui_desc_t* desc); -SOKOL_API_DECL void simgui_new_frame(int width, int height, double delta_time); -SOKOL_API_DECL void simgui_render(void); +SOKOL_IMGUI_API_DECL void simgui_setup(const simgui_desc_t* desc); +SOKOL_IMGUI_API_DECL void simgui_new_frame(int width, int height, double delta_time); +SOKOL_IMGUI_API_DECL void simgui_render(void); #if !defined(SOKOL_IMGUI_NO_SOKOL_APP) -SOKOL_API_DECL bool simgui_handle_event(const sapp_event* ev); +SOKOL_IMGUI_API_DECL bool simgui_handle_event(const sapp_event* ev); #endif -SOKOL_API_DECL void simgui_shutdown(void); +SOKOL_IMGUI_API_DECL void simgui_shutdown(void); #ifdef __cplusplus } /* extern "C" */ diff --git a/util/sokol_memtrack.h b/util/sokol_memtrack.h index 1af0dc93..d9ebaeea 100644 --- a/util/sokol_memtrack.h +++ b/util/sokol_memtrack.h @@ -16,7 +16,7 @@ Optionally provide the following defines with your own implementations: - SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_MEMTRACK_API_DECL - public function declaration prefix (default: extern) SOKOL_API_IMPL - public function implementation prefix (default: -) If sokol_memtrack.h is compiled as a DLL, define the following before @@ -73,13 +73,17 @@ #include <stddef.h> #include <stdint.h> -#ifndef SOKOL_API_DECL +#if defined(SOKOL_API_DECL) && !defined(SOKOL_MEMTRACK_API_DECL) + #define SOKOL_MEMTRACK_API_DECL SOKOL_API_DECL +#endif + +#ifndef SOKOL_MEMTRACK_API_DECL #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) -#define SOKOL_API_DECL __declspec(dllexport) +#define SOKOL_MEMTRACK_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) -#define SOKOL_API_DECL __declspec(dllimport) +#define SOKOL_MEMTRACK_API_DECL __declspec(dllimport) #else -#define SOKOL_API_DECL extern +#define SOKOL_MEMTRACK_API_DECL extern #endif #endif @@ -92,7 +96,7 @@ typedef struct smemtrack_info_t { int num_bytes; } smemtrack_info_t; -SOKOL_API_DECL smemtrack_info_t smemtrack_info(void); +SOKOL_MEMTRACK_API_DECL smemtrack_info_t smemtrack_info(void); #ifdef __cplusplus } /* extern "C" */ diff --git a/util/sokol_shape.h b/util/sokol_shape.h index 3317b603..d441a88e 100644 --- a/util/sokol_shape.h +++ b/util/sokol_shape.h @@ -16,7 +16,7 @@ ...optionally provide the following macros to override defaults: SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) - SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_SHAPE_API_DECL- public function declaration prefix (default: extern) SOKOL_API_IMPL - public function implementation prefix (default: -) If sokol_shape.h is compiled as a DLL, define the following before @@ -24,7 +24,7 @@ SOKOL_DLL - On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + On Windows, SOKOL_DLL will define SOKOL_SHAPE_API_DECL as __declspec(dllexport) or __declspec(dllimport) as needed. FEATURE OVERVIEW @@ -364,13 +364,17 @@ #error "Please include sokol_gfx.h before sokol_shape.h" #endif -#ifndef SOKOL_API_DECL +#if defined(SOKOL_API_DECL) && !defined(SOKOL_SHAPE_API_DECL) + #define SOKOL_SHAPE_API_DECL SOKOL_API_DECL +#endif + +#ifndef SOKOL_SHAPE_API_DECL #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) -#define SOKOL_API_DECL __declspec(dllexport) +#define SOKOL_SHAPE_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) -#define SOKOL_API_DECL __declspec(dllimport) +#define SOKOL_SHAPE_API_DECL __declspec(dllimport) #else -#define SOKOL_API_DECL extern +#define SOKOL_SHAPE_API_DECL extern #endif #endif @@ -472,38 +476,38 @@ typedef struct sshape_torus_t { } sshape_torus_t; /* shape builder functions */ -SOKOL_API_DECL sshape_buffer_t sshape_build_plane(const sshape_buffer_t* buf, const sshape_plane_t* params); -SOKOL_API_DECL sshape_buffer_t sshape_build_box(const sshape_buffer_t* buf, const sshape_box_t* params); -SOKOL_API_DECL sshape_buffer_t sshape_build_sphere(const sshape_buffer_t* buf, const sshape_sphere_t* params); -SOKOL_API_DECL sshape_buffer_t sshape_build_cylinder(const sshape_buffer_t* buf, const sshape_cylinder_t* params); -SOKOL_API_DECL sshape_buffer_t sshape_build_torus(const sshape_buffer_t* buf, const sshape_torus_t* params); +SOKOL_SHAPE_API_DECL sshape_buffer_t sshape_build_plane(const sshape_buffer_t* buf, const sshape_plane_t* params); +SOKOL_SHAPE_API_DECL sshape_buffer_t sshape_build_box(const sshape_buffer_t* buf, const sshape_box_t* params); +SOKOL_SHAPE_API_DECL sshape_buffer_t sshape_build_sphere(const sshape_buffer_t* buf, const sshape_sphere_t* params); +SOKOL_SHAPE_API_DECL sshape_buffer_t sshape_build_cylinder(const sshape_buffer_t* buf, const sshape_cylinder_t* params); +SOKOL_SHAPE_API_DECL sshape_buffer_t sshape_build_torus(const sshape_buffer_t* buf, const sshape_torus_t* params); /* query required vertex- and index-buffer sizes in bytes */ -SOKOL_API_DECL sshape_sizes_t sshape_plane_sizes(uint32_t tiles); -SOKOL_API_DECL sshape_sizes_t sshape_box_sizes(uint32_t tiles); -SOKOL_API_DECL sshape_sizes_t sshape_sphere_sizes(uint32_t slices, uint32_t stacks); -SOKOL_API_DECL sshape_sizes_t sshape_cylinder_sizes(uint32_t slices, uint32_t stacks); -SOKOL_API_DECL sshape_sizes_t sshape_torus_sizes(uint32_t sides, uint32_t rings); +SOKOL_SHAPE_API_DECL sshape_sizes_t sshape_plane_sizes(uint32_t tiles); +SOKOL_SHAPE_API_DECL sshape_sizes_t sshape_box_sizes(uint32_t tiles); +SOKOL_SHAPE_API_DECL sshape_sizes_t sshape_sphere_sizes(uint32_t slices, uint32_t stacks); +SOKOL_SHAPE_API_DECL sshape_sizes_t sshape_cylinder_sizes(uint32_t slices, uint32_t stacks); +SOKOL_SHAPE_API_DECL sshape_sizes_t sshape_torus_sizes(uint32_t sides, uint32_t rings); /* extract sokol-gfx desc structs and primitive ranges from build state */ -SOKOL_API_DECL sshape_element_range_t sshape_element_range(const sshape_buffer_t* buf); -SOKOL_API_DECL sg_buffer_desc sshape_vertex_buffer_desc(const sshape_buffer_t* buf); -SOKOL_API_DECL sg_buffer_desc sshape_index_buffer_desc(const sshape_buffer_t* buf); -SOKOL_API_DECL sg_buffer_layout_desc sshape_buffer_layout_desc(void); -SOKOL_API_DECL sg_vertex_attr_desc sshape_position_attr_desc(void); -SOKOL_API_DECL sg_vertex_attr_desc sshape_normal_attr_desc(void); -SOKOL_API_DECL sg_vertex_attr_desc sshape_texcoord_attr_desc(void); -SOKOL_API_DECL sg_vertex_attr_desc sshape_color_attr_desc(void); +SOKOL_SHAPE_API_DECL sshape_element_range_t sshape_element_range(const sshape_buffer_t* buf); +SOKOL_SHAPE_API_DECL sg_buffer_desc sshape_vertex_buffer_desc(const sshape_buffer_t* buf); +SOKOL_SHAPE_API_DECL sg_buffer_desc sshape_index_buffer_desc(const sshape_buffer_t* buf); +SOKOL_SHAPE_API_DECL sg_buffer_layout_desc sshape_buffer_layout_desc(void); +SOKOL_SHAPE_API_DECL sg_vertex_attr_desc sshape_position_attr_desc(void); +SOKOL_SHAPE_API_DECL sg_vertex_attr_desc sshape_normal_attr_desc(void); +SOKOL_SHAPE_API_DECL sg_vertex_attr_desc sshape_texcoord_attr_desc(void); +SOKOL_SHAPE_API_DECL sg_vertex_attr_desc sshape_color_attr_desc(void); /* helper functions to build packed color value from floats or bytes */ -SOKOL_API_DECL uint32_t sshape_color_4f(float r, float g, float b, float a); -SOKOL_API_DECL uint32_t sshape_color_3f(float r, float g, float b); -SOKOL_API_DECL uint32_t sshape_color_4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a); -SOKOL_API_DECL uint32_t sshape_color_3b(uint8_t r, uint8_t g, uint8_t b); +SOKOL_SHAPE_API_DECL uint32_t sshape_color_4f(float r, float g, float b, float a); +SOKOL_SHAPE_API_DECL uint32_t sshape_color_3f(float r, float g, float b); +SOKOL_SHAPE_API_DECL uint32_t sshape_color_4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_SHAPE_API_DECL uint32_t sshape_color_3b(uint8_t r, uint8_t g, uint8_t b); /* adapter function for filling matrix struct from generic float[16] array */ -SOKOL_API_DECL sshape_mat4_t sshape_mat4(const float m[16]); -SOKOL_API_DECL sshape_mat4_t sshape_mat4_transpose(const float m[16]); +SOKOL_SHAPE_API_DECL sshape_mat4_t sshape_mat4(const float m[16]); +SOKOL_SHAPE_API_DECL sshape_mat4_t sshape_mat4_transpose(const float m[16]); #ifdef __cplusplus } // extern "C" @@ -1169,7 +1173,7 @@ static void _sshape_build_cylinder_cap_ring(sshape_buffer_t* buf, const sshape_c } } -SOKOL_API_DECL sshape_buffer_t sshape_build_cylinder(const sshape_buffer_t* in_buf, const sshape_cylinder_t* in_params) { +SOKOL_SHAPE_API_DECL sshape_buffer_t sshape_build_cylinder(const sshape_buffer_t* in_buf, const sshape_cylinder_t* in_params) { SOKOL_ASSERT(in_buf && in_params); const sshape_cylinder_t params = _sshape_cylinder_defaults(in_params); const uint32_t num_vertices = _sshape_cylinder_num_vertices(params.slices, params.stacks); @@ -1350,7 +1354,7 @@ SOKOL_API_IMPL sg_buffer_desc sshape_index_buffer_desc(const sshape_buffer_t* bu return desc; } -SOKOL_API_DECL sshape_element_range_t sshape_element_range(const sshape_buffer_t* buf) { +SOKOL_SHAPE_API_DECL sshape_element_range_t sshape_element_range(const sshape_buffer_t* buf) { SOKOL_ASSERT(buf && buf->valid); SOKOL_ASSERT(buf->indices.shape_offset < buf->indices.data_size); SOKOL_ASSERT(0 == (buf->indices.shape_offset & (sizeof(uint16_t) - 1))); |