~thumper/glint/simple-app

« back to all changes in this revision

Viewing changes to src/internal/ShaderImpl.cpp

  • Committer: Michi Henning
  • Date: 2012-12-11 05:05:01 UTC
  • Revision ID: michi.henning@canonical.com-20121211050501-bzt22r021la4knct
Added test to enforce that client API's use of GL or GLES headers matches the headers that were used to compile the glint library they link with.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
ShaderImpl::
34
34
supports_compiled_shaders()
35
35
{
36
 
#if defined(GL_SHADER_COMPILER) // Only available in GLES
 
36
    if (gl_environment == GLEnv::OpenGL)
 
37
    {
 
38
        return true;    // OpenGL provides shader compilation from 2.0 onwards
 
39
    }
 
40
 
 
41
    // GLES may not support compiled shaders in some implementations.
37
42
    GLboolean b;
38
43
    glGetBooleanv(GL_SHADER_COMPILER, &b);
39
44
    check_gl("cannot read GL_SHADER_COMPILER");
40
45
    return b;
41
 
#else
42
 
    return true;    // With GL, shader compilation is always supported
43
 
#endif
44
46
}
45
47
 
46
48
namespace