mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
desktop-main.cpp: round the fractional part of the GL version
When verMinor is extracted with the glGetString() method, use roundf() to round the GL MINOR version to an integer. 2.1 is split in 2 and 1. Without this patch rounding issues are present as for 32bit IEEE the default rounding makes (0.1f * 10.f) into 0.999999f. Given the MINOR is a single digit for GL, calling roundf() on 0.999999 gives the expected result 1 for the MINOR. Reported-by: Murillo Fernandes Bernardes <notifications@github.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
28299b0ebc
commit
6bab8267eb
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ void validateGL()
|
|||
}
|
||||
if (sscanf(verChar, "%f", &verFloat) == 1) {
|
||||
verMajor = (GLint)verFloat;
|
||||
verMinor = (GLint)((verFloat - verMajor) * 10.f);
|
||||
verMinor = (GLint)roundf((verFloat - verMajor) * 10.f);
|
||||
}
|
||||
}
|
||||
// attempt to detect version using the newer API
|
||||
|
|
Loading…
Reference in a new issue