mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Add some more graphics feature and limit queries (resolves issue #1234).
love.graphics.getSupported(): - Added “fullnpot” field, is true everywhere except on some older mobile devices. If false, mipmapping and wrap modes other than “clamp” can’t be used on non-power-of-two sized textures. - Added “pixelshaderhighp” field, is true everywhere except some older mobile devices. If false, “highp” precision can’t be used in pixel shaders and love will default to “mediump” instead. love.graphics.getSystemLimits(): - Added “anisotropy” field, gets the maximum amount of anisotropy you can specify in Texture:setFilter. love will clamp anisotropy arguments greater than this value. --HG-- branch : minor
This commit is contained in:
@@ -2009,6 +2009,8 @@ double Graphics::getSystemLimit(SystemLimit limittype) const
|
||||
return (double) gl.getMaxRenderTargets();
|
||||
case Graphics::LIMIT_CANVAS_MSAA:
|
||||
return (double) gl.getMaxRenderbufferSamples();
|
||||
case Graphics::LIMIT_ANISOTROPY:
|
||||
return (double) gl.getMaxAnisotropy();
|
||||
default:
|
||||
return 0.0;
|
||||
}
|
||||
@@ -2024,6 +2026,10 @@ bool Graphics::isSupported(Feature feature) const
|
||||
return gl.isClampZeroTextureWrapSupported();
|
||||
case FEATURE_LIGHTEN:
|
||||
return GLAD_VERSION_1_4 || GLAD_ES_VERSION_3_0 || GLAD_EXT_blend_minmax;
|
||||
case FEATURE_FULL_NPOT:
|
||||
return GLAD_VERSION_2_0 || GLAD_ES_VERSION_3_0 || GLAD_OES_texture_npot;
|
||||
case FEATURE_PIXEL_SHADER_HIGHP:
|
||||
return gl.isPixelShaderHighpSupported();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user