Skip to content

Commit

Permalink
Use strcmp() to compare char* strings (openscad#4965)
Browse files Browse the repository at this point in the history
  • Loading branch information
kintel authored Feb 4, 2024
1 parent f3de518 commit 6d505e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/glview/OffscreenView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ OffscreenView::OffscreenView(uint32_t width, uint32_t height)
// FIXME: It's possible that GLEW was built using EGL, in which case this
// logic isn't correct, but we don't have a good way of determining how GLEW was built.
#if defined(USE_GLEW) || defined(OPENCSG_GLEW)
provider = provider == "egl" ? "glx" : provider;
provider = !strcmp(provider, "egl") ? "glx-old" : provider;
#endif
this->ctx = OffscreenContextFactory::create(provider, attrib);
if (!this->ctx) {
// If the provider defaulted to EGL, fall back to GLX if EGL failed
if (provider == "egl") {
this->ctx = OffscreenContextFactory::create("glx", attrib);
if (!strcmp(provider, "egl")) {
this->ctx = OffscreenContextFactory::create("glx-old", attrib);
}
if (!this->ctx) {
throw OffscreenViewException("Unable to obtain GL Context");
Expand Down

0 comments on commit 6d505e4

Please sign in to comment.