From fcc10d635829e3342ad4d4180cf704324526c9a7 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 13 Jan 2020 20:59:31 +0200 Subject: [PATCH] gg: fixes same image twice lead to invisible rectangles sometimes --- vlib/gg/gg.v | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vlib/gg/gg.v b/vlib/gg/gg.v index 1364a33c96..68ebfc91a8 100644 --- a/vlib/gg/gg.v +++ b/vlib/gg/gg.v @@ -414,7 +414,10 @@ pub fn (c &GG) draw_vertical(x, y, height int) { // fn (ctx &GG) draw_image(x, y, w, h f32, img stbi.Image) { pub fn (ctx &GG) draw_image(x, y, w, h f32, tex_id u32) { - + + // NB: HACK to ensure same state ... TODO: remove next line + ctx.draw_empty_rect(0,0,0,0, gx.white) + last_array_buffer := 0 last_texture := 0 C.glGetIntegerv(C.GL_ARRAY_BUFFER_BINDING, &last_array_buffer)