summaryrefslogtreecommitdiffstats
path: root/subsurface-desktop-main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'subsurface-desktop-main.cpp')
-rw-r--r--subsurface-desktop-main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index 5b8424487..c439179c8 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -152,7 +152,6 @@ void validateGL()
QOffscreenSurface surface;
QOpenGLFunctions *func;
const char *verChar;
- float verFloat;
surface.setFormat(ctx.format());
surface.create();
@@ -182,9 +181,10 @@ void validateGL()
"before running Subsurface!\n").toUtf8().data();
return;
}
- if (sscanf(verChar, "%f", &verFloat) == 1) {
- verMajor = (GLint)verFloat;
- verMinor = (GLint)roundf((verFloat - verMajor) * 10.f);
+ int min, maj;
+ if (sscanf(verChar, "%d.%d", &maj, &min) == 2) {
+ verMajor = (GLint)maj;
+ verMinor = (GLint)min;
}
}
// attempt to detect version using the newer API