Browse Source

Better parsing of openGL SL version number.

tags/2021-05-28
jules 11 years ago
parent
commit
35fd84cc52
2 changed files with 2 additions and 13 deletions
  1. +0
    -4
      extras/Demo/Source/Demos/OpenGLDemo.cpp
  2. +2
    -9
      modules/juce_opengl/opengl/juce_OpenGLShaderProgram.cpp

+ 0
- 4
extras/Demo/Source/Demos/OpenGLDemo.cpp 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
{


+ 2
- 9
modules/juce_opengl/opengl/juce_OpenGLShaderProgram.cpp 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)


Loading…
Cancel
Save