diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-02-21 16:30:10 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-02-22 20:04:37 +0200 |
commit | 0562bcb418d8e1af7e181264bb763a071854f7e1 (patch) | |
tree | 6432cc3c9fabc00994cbb9f1ed0180e51f499675 /src | |
parent | 092213091b112ede2448c4a775505c5ffbdc9a41 (diff) | |
download | qtlocation-mapboxgl-0562bcb418d8e1af7e181264bb763a071854f7e1.tar.gz |
[core] Use std::call_once to report about missing VAOs
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/gl/segment.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/gl/segment.hpp b/src/mbgl/gl/segment.hpp index b2761a2102..bd4926476f 100644 --- a/src/mbgl/gl/segment.hpp +++ b/src/mbgl/gl/segment.hpp @@ -5,6 +5,7 @@ #include <mbgl/util/optional.hpp> #include <mbgl/util/logging.hpp> +#include <mutex> #include <cstddef> #include <vector> @@ -46,11 +47,10 @@ public: } } else { // No VAO support. Force attributes to be rebound. - static bool reported = false; - if (!reported) { + static std::once_flag reportedOnce; + std::call_once(reportedOnce, [] { Log::Warning(Event::OpenGL, "Not using Vertex Array Objects"); - reported = true; - } + }); context.elementBuffer = indexBuffer_; variableBindings = {}; } |