Commit 302629d5 authored by Martin Flöser's avatar Martin Flöser
Browse files

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 db42152d

CCBUG: 299426
parent eb098cc6
......@@ -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()
......
......@@ -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()
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment