From df4e2bf029316058b3feb5746762431eff6e2521 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Mon, 29 Mar 2021 17:19:39 +0900 Subject: [PATCH] WIP fix rendering of drawCache's texture --- src/state.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/state.cpp b/src/state.cpp index 516574f..c44e627 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -293,7 +293,18 @@ void Tri::State::draw() { // draw cache initialized check_draw_cache(); BeginDrawing(); - DrawTexture(drawCache.texture, 0, 0, WHITE); + // hack to flip in the y direction, since RenderTexture2D's texture + // is flipped + DrawTextureRec( + drawCache.texture, + { + 0.0f, + 0.0f, + (float)drawCache.texture.width, + (float)-drawCache.texture.height + }, + {0.0f, 0.0f}, + WHITE); } else { BeginDrawing(); draw_to_target(nullptr);