memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.15k stars 771 forks source link

nvgTextBounds and VC 16.4.4 #557

Closed alexzk1 closed 4 years ago

alexzk1 commented 4 years ago

So next code

float bounds[4] = {0.f, 0.f, 0.f, 0.f};
 nvgTextAlign(ctx, align);
 nvgTextBounds(ctx, x, y, text.c_str(), NULL, bounds);
 nvgBeginPath(ctx);

Fails to work with VC 16.4.4. It does not set bounds. However, when I compile binary by older 16.3 compiler and upload to that machine with all that DLLs they have (made by vcpkg there) it works OK. Also works OK on linux/mac. Any ideas?

Upd: managed to make debug build there, this line works with 16.4.4 compiler: if (state->fontId == FONS_INVALID) return 0; Upd2: Stepping slowly by debuger, and 1 of texts was shown ok ... it seems some thread issues, however, there are no threads there except any added by nanogui (if any). Upd3: removed Upd4: in debug mode it just works even without mutexes.

alexzk1 commented 4 years ago

Ok, figured. Used debug build of "nanogui" with release binary. For some reason builts by 16.3 was working ok wtih that dll.