Open tanis2000 opened 5 years ago
Could you please list all flags (https://github.com/vurtun/nuklear/blob/master/nuklear.h#L94 ) which you use for the compilation into web-assembly?
E.g. the integer overflows are solely dependent on these flags.
Sure, here's the relevant code:
#define NK_INCLUDE_FIXED_TYPES
#define NK_INCLUDE_DEFAULT_FONT
#define NK_INCLUDE_DEFAULT_ALLOCATOR
#define NK_INCLUDE_FONT_BAKING
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
#define NK_IMPLEMENTATION
#include "nuklear.h"
Did you define the following in your C files as well as in your header files?
#define NK_INCLUDE_FIXED_TYPES
#define NK_INCLUDE_DEFAULT_FONT
#define NK_INCLUDE_DEFAULT_ALLOCATOR
#define NK_INCLUDE_FONT_BAKING
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
No, I have those in my C file only. There’s nothing about nuklear in the headers. You can check out the actual code as I released it for the LD43 compo: https://tanis.itch.io/santa-frowns-to-town
It looks like on macOS and Web Assembly (but maybe other platforms as well) there are lots of integer overflows happening. Here's a sample from one of my apps:
I'm not familiar with Nuklear's code base but I suppose that it's either because of something done in the wrong way or because of the 64bit platform it's being compiled against. Either way it would be nice to solve those issues as they prevent compiling to web assembly without activating the
clamp
option that actually produces dead slow code.