jdryg / vg-renderer

A vector graphics renderer for bgfx, based on ideas from NanoVG and ImDrawList (Dear ImGUI)
BSD 2-Clause "Simplified" License
503 stars 55 forks source link

Doesn't compile on gcc and clang #6

Closed hugoam closed 5 years ago

hugoam commented 6 years ago

There are a bunch of compile errors when trying to compile with gcc or clang : https://gist.github.com/hugoam/fe72597497fea5501588e633de030066 Basically the problems are :

jdryg commented 6 years ago

Thanks! I haven't had the chance to try it with gcc/clang yet, that's why I missed those. Should be fixed in the cmdlists branch, which I assume is the branch you are using (right?).

jdryg commented 6 years ago

cmdlists branch merged to master. I'm keeping this open until I manage to properly test it on gcc/clang on my own. If anything else regarding compile/link errors comes up, feel free to post it here.

hugoam commented 6 years ago

Hey ! I just pulled last commit from master and I get a compile error in stroker.cpp : fabs is not defined

I fixed it by adding #include <cmath> but that might not be the correct fix, just letting you know so you can fix it proper !

jdryg commented 6 years ago

Fixed! It was a leftover from my external SIMD tests. For some reason MSVC didn't complain which I guess means that cmath/math.h was included somewhere.

hugoam commented 6 years ago

Thanks ! Also this is just a warning but you might want to fix it since it's in the header :

../../../mud/3rdparty/vg-renderer/include/vg/vg.h:82:40: warning: missing initializer for member ‘vg::GradientHandle::flags’ [-Wmissing-field-initializers]
 #define VG_INVALID_HANDLE { UINT16_MAX }
                                        ^
../../../mud/3rdparty/vg-renderer/src/vg.cpp:3437:10: note: in expansion of macro ‘VG_INVALID_HANDLE’
   return VG_INVALID_HANDLE;
jdryg commented 6 years ago

Fixed.

hugoam commented 6 years ago

Cool ! Now I'm trying to build with Emscripten right now which I guess went out of sync : this line : https://github.com/jdryg/vg-renderer/blob/master/src/vg.cpp#L2190 needs to be :

    if (!bx::isPowerOf2(w) || !bx::isPowerOf2(h)) {

and this line : https://github.com/jdryg/vg-renderer/blob/master/src/vg.cpp#L1036 needs to be enclosed in a BX_CONFIG_SUPPORTS_THREADING guard

#if BX_CONFIG_SUPPORTS_THREADING
    BX_DELETE(allocator, ctx->m_DataPoolMutex);
#endif