mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-20 08:21:56 +09:00
[Refactor] (BackendLoader): share extension name matching between GLES and EGL probes
This commit is contained in:
@@ -21,6 +21,17 @@
|
||||
#endif
|
||||
|
||||
namespace MobileGL::MG_Util::BackendLoader {
|
||||
Bool HasExtensionWord(const char* list, const char* word) {
|
||||
if (list == nullptr || word == nullptr || *word == '\0') return false;
|
||||
const SizeT n = std::strlen(word);
|
||||
for (const char* at = std::strstr(list, word); at != nullptr; at = std::strstr(at + 1, word)) {
|
||||
const Bool startOk = at == list || at[-1] == ' ';
|
||||
const Bool endOk = at[n] == '\0' || at[n] == ' ';
|
||||
if (startOk && endOk) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static Bool UseAngle() {
|
||||
return MG_Config::Features.EsprytUseAngle;
|
||||
}
|
||||
|
||||
@@ -1364,6 +1364,8 @@ namespace MobileGL {
|
||||
} // namespace MG_External
|
||||
|
||||
namespace MG_Util::BackendLoader {
|
||||
// Match a complete name in a space-separated GLES/EGL extension string.
|
||||
Bool HasExtensionWord(const char* list, const char* word);
|
||||
void AcquireGLESFunctions(MG_External::GLESFunctionsTable& funcs,
|
||||
MG_External::EGL::eglGetProcAddress_PTR procAddress);
|
||||
void AcquireEGLFunctions(MG_External::EGLFunctionsTable& funcs);
|
||||
|
||||
Reference in New Issue
Block a user