[core] Use std::call_once to report about missing VAOs

This commit is contained in:
Bruno de Oliveira Abinader
2017-02-21 16:30:10 +02:00
parent 092213091b
commit 0562bcb418

View File

@@ -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 = {};
}