Properly detect effects which need OpenGL 2

Effects that need GLSL require that OpenGL 2 is active.
It does not matter whether the GPU would support it if
OpenGL 2 is not used.

Cherry-picked from db42152

CCBUG: 299426
This commit is contained in:
Martin Gräßlin 2012-05-04 11:31:06 +02:00
parent ed2fabf527
commit a79eacaed7
3 changed files with 15 additions and 7 deletions

View file

@ -60,8 +60,11 @@ ExplosionEffect::~ExplosionEffect()
bool ExplosionEffect::supported()
{
return GLPlatform::instance()->supports(GLSL) &&
(effects->compositingType() == OpenGLCompositing);
if (effects->compositingType() == OpenGLCompositing) {
return ShaderManager::instance()->isValid();
} else {
return false;
}
}
bool ExplosionEffect::loadData()

View file

@ -64,8 +64,11 @@ InvertEffect::~InvertEffect()
bool InvertEffect::supported()
{
return GLPlatform::instance()->supports(GLSL) &&
(effects->compositingType() == OpenGLCompositing);
if (effects->compositingType() == OpenGLCompositing) {
return ShaderManager::instance()->isValid();
} else {
return false;
}
}
bool InvertEffect::loadData()

View file

@ -79,9 +79,11 @@ LookingGlassEffect::~LookingGlassEffect()
bool LookingGlassEffect::supported()
{
return GLRenderTarget::supported() &&
GLPlatform::instance()->supports(GLSL) &&
(effects->compositingType() == OpenGLCompositing);
if (effects->compositingType() == OpenGLCompositing) {
return ShaderManager::instance()->isValid() && GLRenderTarget::supported();
} else {
return false;
}
}
void LookingGlassEffect::reconfigure(ReconfigureFlags)