mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Fix videos not setting their textures in the first frame, on some backends.
This commit is contained in:
@@ -115,6 +115,15 @@ void Video::draw(Graphics *gfx, const Matrix4 &m)
|
|||||||
{
|
{
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
// setVideoTextures may call flushBatchedDraws before setting the textures, so
|
||||||
|
// we can't call it after requestBatchedDraw.
|
||||||
|
auto shader = Shader::current;
|
||||||
|
if (Shader::isDefaultActive())
|
||||||
|
shader = Shader::standardShaders[Shader::STANDARD_VIDEO];
|
||||||
|
|
||||||
|
if (shader != nullptr)
|
||||||
|
shader->setVideoTextures(textures[0], textures[1], textures[2]);
|
||||||
|
|
||||||
const Matrix4 &tm = gfx->getTransform();
|
const Matrix4 &tm = gfx->getTransform();
|
||||||
bool is2D = tm.isAffine2DTransform();
|
bool is2D = tm.isAffine2DTransform();
|
||||||
|
|
||||||
@@ -145,9 +154,6 @@ void Video::draw(Graphics *gfx, const Matrix4 &m)
|
|||||||
verts[i].color = c;
|
verts[i].color = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Shader::current != nullptr)
|
|
||||||
Shader::current->setVideoTextures(textures[0], textures[1], textures[2]);
|
|
||||||
|
|
||||||
gfx->flushBatchedDraws();
|
gfx->flushBatchedDraws();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user