Skip to content

Commit

Permalink
extension thing is funny
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Feb 3, 2024
1 parent c1ba1fb commit a8fcf47
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,13 @@ void DevTools::render(GLRenderCtx* ctx) {
}

bool DevTools::hasExtension(const std::string& ext) const {
GLint extensionCount = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &extensionCount);

for (GLint i = 0; i < extensionCount; i++) {
const char* extension = reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i));
if (ext == extension) {
return true;
}
auto exts = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
if (exts == nullptr) {
return false;
}
return false;

std::string extsStr(exts);
return extsStr.find(ext) != std::string::npos;
}

namespace {
Expand Down

0 comments on commit a8fcf47

Please sign in to comment.