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:
parent
ed2fabf527
commit
a79eacaed7
3 changed files with 15 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue