Show line width range in info

pull/896/head
Levin Li 2020-12-05 17:37:46 +08:00
parent 4e5d5bd33b
commit c31e0da681
3 changed files with 9 additions and 0 deletions

View File

@ -15,6 +15,7 @@ bool ARB_shader_texture_lod = false;
bool EXT_texture_compression_s3tc = false;
bool EXT_texture_filter_anisotropic = false;
GLint maxPointSize = 0;
GLfloat maxLineWidth = 0;
namespace
{
@ -37,12 +38,16 @@ bool init() noexcept
EXT_texture_filter_anisotropic = has_extension("GL_EXT_texture_filter_anisotropic");
GLint pointSizeRange[2];
GLfloat lineWidthRange[2];
#ifdef GL_ES
glGetIntegerv(GL_ALIASED_POINT_SIZE_RANGE, pointSizeRange);
glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, lineWidthRange);
#else
glGetIntegerv(GL_SMOOTH_POINT_SIZE_RANGE, pointSizeRange);
glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, lineWidthRange);
#endif
maxPointSize = pointSizeRange[1];
maxLineWidth = lineWidthRange[1];
return true;
}

View File

@ -43,6 +43,7 @@ extern bool ARB_vertex_array_object;
extern bool EXT_framebuffer_object;
#endif
extern GLint maxPointSize;
extern GLfloat maxLineWidth;
bool init() noexcept;
bool checkVersion(int) noexcept;

View File

@ -122,6 +122,9 @@ std::string Helper::getRenderInfo(const Renderer *r)
if (info.count("PointSizeMax") > 0 && info.count("PointSizeMin") > 0)
s += fmt::sprintf(_("Point size range: %s - %s\n"), info["PointSizeMin"], info["PointSizeMax"]);
if (info.count("LineWidthMax") > 0 && info.count("LineWidthMin") > 0)
s += fmt::sprintf(_("Line width range: %s - %s\n"), info["LineWidthMin"], info["LineWidthMax"]);
if (info.count("PointSizeGran") > 0)
s += fmt::sprintf(_("Point size granularity: %s\n"), info["PointSizeGran"]);