From 13b5450ff92bb983cb3b8c5bdcca46f653d63f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Garc=C3=ADa=20Garc=C3=ADa?= Date: Wed, 3 Jun 2020 20:00:29 +0200 Subject: [PATCH] [GL1] Initial changes for hw context without FBO --- gfx/drivers/gl1.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gfx/drivers/gl1.c b/gfx/drivers/gl1.c index b26fabea6a..19e14f13b6 100644 --- a/gfx/drivers/gl1.c +++ b/gfx/drivers/gl1.c @@ -727,11 +727,7 @@ static bool gl1_gfx_frame(void *data, const void *frame, video_width, video_height, false, true); } - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); if ( gl1->video_width != frame_width || gl1->video_height != frame_height || @@ -760,9 +756,10 @@ static bool gl1_gfx_frame(void *data, const void *frame, pot_width = get_pot(width); pot_height = get_pot(height); - if ( frame_width == 4 && + if ( frame == RETRO_HW_FRAME_BUFFER_VALID || ( + frame_width == 4 && frame_height == 4 && - (frame_width < width && frame_height < height) + (frame_width < width && frame_height < height)) ) draw = false; @@ -794,6 +791,12 @@ static bool gl1_gfx_frame(void *data, const void *frame, if (draw) { + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + if (frame_to_copy) draw_tex(gl1, pot_width, pot_height, width, height, gl1->tex, frame_to_copy);