Skip to content

Commit cf3c043

Browse files
committed
fix underlays on GL2 driver
1 parent fde2739 commit cf3c043

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

gfx/drivers/gl2.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3756,18 +3756,22 @@ static bool gl2_frame(void *data, const void *frame,
37563756
/* Render background overlay (behind game viewport) */
37573757
if ((gl->flags & GL2_FLAG_OVERLAY_ENABLE) && (gl->flags & GL2_FLAG_OVERLAY_BACKGROUND_FILL))
37583758
{
3759-
/* Save current fullscreen state and force full screen for background overlay */
37603759
uint64_t saved_flags = gl->flags & GL2_FLAG_OVERLAY_FULLSCREEN;
3760+
struct video_coords saved_coords = gl->coords;
3761+
37613762
gl->flags |= GL2_FLAG_OVERLAY_FULLSCREEN;
37623763

37633764
gl2_render_overlay(gl);
37643765

3765-
/* Restore fullscreen state and viewport */
3766+
/* Restore state */
37663767
if (!saved_flags)
37673768
gl->flags &= ~GL2_FLAG_OVERLAY_FULLSCREEN;
37683769

3769-
/* Restore viewport for game rendering */
3770+
gl->coords = saved_coords;
37703771
glViewport(gl->vp.x, gl->vp.y, gl->vp.width, gl->vp.height);
3772+
3773+
/* Re-bind game texture since overlay rendering left overlay texture bound */
3774+
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
37713775
}
37723776
#endif
37733777

0 commit comments

Comments
 (0)