Skip to content

Commit

Permalink
Merge pull request #12 from theyamo/fix-float-issue
Browse files Browse the repository at this point in the history
Avoid locale related parsing issues
  • Loading branch information
drug007 authored Mar 25, 2019
2 parents e513e34 bbd51b5 commit be5124c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/nanogui/arsdbackend.d
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 43,13 @@ class ArsdBackend
{
this(int w, int h, string title)
{
/* Avoid locale-related number parsing issues */
version(Windows) {}
else {
import core.stdc.locale;
setlocale(LC_NUMERIC, "C");
}

// we need at least OpenGL3 with GLSL to use NanoVega,
// so let's tell simpledisplay about that
setOpenGLContextVersion(3, 0);
Expand Down
7 changes: 7 additions & 0 deletions source/nanogui/sdlbackend.d
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 24,13 @@ class SdlBackend : Screen
{
this(int w, int h, string title)
{
/* Avoid locale-related number parsing issues */
version(Windows) {}
else {
import core.stdc.locale;
setlocale(LC_NUMERIC, "C");
}

import gfm.sdl2;

this.width = w;
Expand Down

0 comments on commit be5124c

Please sign in to comment.