Fix Canvas flushing;

This commit is contained in:
bjorn 2021-03-04 21:50:25 -07:00
parent 9f0826e3b7
commit a3b791a7e7
1 changed files with 3 additions and 0 deletions

View File

@ -422,6 +422,9 @@ Canvas* lovrGraphicsGetCanvas() {
void lovrGraphicsSetCanvas(Canvas* canvas) {
if (state.canvas && canvas != state.canvas) {
// The canvas must be flushed because if someone uses its textures to do a draw there is no way
// to know that using that Texture requires the Canvas' batches to be flushed.
lovrGraphicsFlushCanvas(state.canvas);
lovrCanvasResolve(state.canvas);
}