Update nuklear.h

This commit is contained in:
Nielsbishere 2019-12-04 15:38:36 +01:00 committed by GitHub
parent 3adc4a0a7b
commit d0c22ebf09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 1 deletions

View File

@ -5715,9 +5715,11 @@ template<typename T> struct nk_alignof{struct Big {T x; char c;}; enum {
#ifndef NK_MEMSET
#define NK_MEMSET nk_memset
#define NK_DEF_MEMSET
#endif
#ifndef NK_MEMCPY
#define NK_MEMCPY nk_memcopy
#define NK_DEF_MEMCPY
#endif
#ifndef NK_SQRT
#define NK_SQRT nk_sqrt
@ -6333,6 +6335,8 @@ NK_LIB int nk_is_upper(int c){return (c >= 'A' && c <= 'Z') || (c >= 0xC0 && c <
NK_LIB int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;}
NK_LIB int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;}
#ifdef NK_DEF_MEMCPY
NK_LIB void*
nk_memcopy(void *dst0, const void *src0, nk_size length)
{
@ -6389,6 +6393,11 @@ nk_memcopy(void *dst0, const void *src0, nk_size length)
done:
return (dst0);
}
#endif
#ifdef NK_DEF_MEMSET
NK_LIB void
nk_memset(void *ptr, int c0, nk_size size)
{
@ -6440,6 +6449,8 @@ nk_memset(void *ptr, int c0, nk_size size)
#undef nk_wsize
#undef nk_wmask
}
#endif
NK_LIB void
nk_zero(void *ptr, nk_size size)
{
@ -9436,6 +9447,8 @@ nk_draw_list_alloc_vertices(struct nk_draw_list *list, nk_size count)
if (!vtx) return 0;
list->vertex_count += (unsigned int)count;
#ifndef NK_UINT_DRAW_INDEX
/* This assert triggers because your are drawing a lot of stuff and nuklear
* defined `nk_draw_index` as `nk_ushort` to safe space be default.
*
@ -9445,8 +9458,11 @@ nk_draw_list_alloc_vertices(struct nk_draw_list *list, nk_size count)
* backend (OpenGL, DirectX, ...). For example in OpenGL for `glDrawElements`
* instead of specifing `GL_UNSIGNED_SHORT` you have to define `GL_UNSIGNED_INT`.
* Sorry for the inconvenience. */
if(sizeof(nk_draw_index)==2) NK_ASSERT((list->vertex_count < NK_USHORT_MAX &&
NK_ASSERT((list->vertex_count < NK_USHORT_MAX &&
"To many verticies for 16-bit vertex indicies. Please read comment above on how to solve this problem"));
#endif
return vtx;
}
NK_INTERN nk_draw_index*