Form Jorge Ciges, improved GL version detection code.

This commit is contained in:
Robert Osfield
2011-05-26 16:52:08 +00:00
parent 3fa1f2ed5a
commit e3f7d802e4
4 changed files with 28 additions and 13 deletions

View File

@@ -15,6 +15,7 @@
#include <string.h>
double osg::asciiToDouble(const char* str)
{
const char* ptr = str;
@@ -112,3 +113,20 @@ double osg::asciiToDouble(const char* str)
}
}
double osg::findAsciiToDouble(const char* str)
{
const char* ptr = str;
double value = 0.0;
while(*ptr != 0) {
if(*ptr>='0' && *ptr<='9') {
value = asciiToDouble(ptr);
return value;
}
++ptr;
}
return 0.0;
}