31 const std::string& extensions_string) {
32 if (unprefixed_extension.empty())
39 while ((found = extensions_string.find(unprefixed_extension, found + 1)) !=
43 size_t found_begin = extensions_string.rfind(
' ', found);
44 if (found_begin != std::string::npos) {
51 for (
size_t c = found_begin; c < found; ++c) {
52 if (!isupper(extensions_string[c]) && extensions_string[c] !=
'_')
58 if (extensions_string.size() > found + unprefixed_extension.size() &&
59 extensions_string[found + unprefixed_extension.size()] !=
' ')
76 LOG(
WARNING) <<
"IsExtensionSupported(" << unprefixed_extension
77 <<
") returning false because there is no OpenGL context.";
80 const char* extensions =
81 reinterpret_cast<const char*
>(glGetString(GL_EXTENSIONS));
82 if (!extensions)
return false;
83 const std::string unprefixed(unprefixed_extension);
85 std::string(extensions));
89 #if defined(ION_PLATFORM_ANDROID) || defined(ION_PLATFORM_GENERIC_ARM)
90 if (!strcmp(unprefixed_extension,
"vertex_array_object"))
ION_API bool IsExtensionIncomplete(const char *unprefixed_extension)
Returns whether the passed extension is known to be incomplete for the current platform.
static const Visual * GetCurrent()
Returns the Visual that is current for the calling thread.
#define LOG(severity)
Logs the streamed message unconditionally with a severity of severity.
ION_API bool IsExtensionSupported(const std::string &unprefixed_extension, const std::string &extensions_string)
Returns whether the currently bound OpenGL implementation supports the named extension.
Copyright 2016 Google Inc.