mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Vertex shaders can write to gl_PointSize (fixes #1603).
If a shader uses gl_PointSize then it can only be used when drawing points. If a shader doesn't use gl_PointSize then it can't be used when drawing points. Added 'ConstantPointSize' and 'CurrentDPIScale' built-in shader uniforms. ConstantPointSize is in DPI-scaled points, whereas gl_PointSize is in pixels, so to get the correct default behaviour a shader needs to do gl_PointSize = ConstantPointSize * CurrentDPIScale
This commit is contained in:
@@ -262,8 +262,12 @@ void Text::draw(Graphics *gfx, const Matrix4 &m)
|
||||
if (Shader::isDefaultActive())
|
||||
Shader::attachDefault(Shader::STANDARD_DEFAULT);
|
||||
|
||||
Texture *firsttex = nullptr;
|
||||
if (!drawCommands.empty())
|
||||
firsttex = drawCommands[0].texture;
|
||||
|
||||
if (Shader::current)
|
||||
Shader::current->checkMainTextureType(TEXTURE_2D, false);
|
||||
Shader::current->validateDrawState(PRIMITIVE_TRIANGLES, firsttex);
|
||||
|
||||
// Re-generate the text if the Font's texture cache was invalidated.
|
||||
if (font->getTextureCacheID() != textureCacheID)
|
||||
|
||||
Reference in New Issue
Block a user