1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

Better parsing of openGL SL version number.

This commit is contained in:
jules 2014-03-22 14:58:30 +00:00
parent aeb6657cb4
commit 35fd84cc52
2 changed files with 2 additions and 13 deletions

View file

@ -810,11 +810,7 @@ struct OpenGLDemoClasses
attributes = new Attributes (openGLContext, *shader);
uniforms = new Uniforms (openGLContext, *shader);
#if ! JUCE_OPENGL_ES
statusText = "GLSL: v" + String (OpenGLShaderProgram::getLanguageVersion(), 2);
#else
statusText = "GLSL ES";
#endif
}
else
{

View file

@ -54,15 +54,8 @@ void OpenGLShaderProgram::release() noexcept
double OpenGLShaderProgram::getLanguageVersion()
{
#if JUCE_OPENGL_ES
// GLES doesn't support this version number, but that shouldn't matter since
// on GLES you probably won't need to check it.
jassertfalse;
return 0;
#else
return String ((const char*) glGetString (GL_SHADING_LANGUAGE_VERSION))
.upToFirstOccurrenceOf (" ", false, false).getDoubleValue();
#endif
return String::fromUTF8 ((const char*) glGetString (GL_SHADING_LANGUAGE_VERSION))
.retainCharacters("1234567890.").getDoubleValue();
}
bool OpenGLShaderProgram::addShader (const String& code, GLenum type)