From eee946890096758bd9ec74149a98daf4b5bfeb45 Mon Sep 17 00:00:00 2001 From: Toad King Date: Mon, 24 Sep 2012 21:25:31 -0400 Subject: [PATCH] fix GLES for VideoCore --- gfx/context/vc_egl_ctx.c | 7 ++++++- gfx/gl.c | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gfx/context/vc_egl_ctx.c b/gfx/context/vc_egl_ctx.c index 2350141ec3..6b04a4af6e 100644 --- a/gfx/context/vc_egl_ctx.c +++ b/gfx/context/vc_egl_ctx.c @@ -172,9 +172,14 @@ static bool gfx_ctx_init(void) vc_dispmanx_display_get_info(dispman_display, &dispman_modeinfo); dispman_update = vc_dispmanx_update_start(0); + VC_DISPMANX_ALPHA_T alpha; + alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; + alpha.opacity = 255; + alpha.mask = 0; + dispman_element = vc_dispmanx_element_add(dispman_update, dispman_display, 0 /*layer*/, &dst_rect, 0 /*src*/, - &src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/, 0 /*clamp*/, DISPMANX_NO_ROTATE); + &src_rect, DISPMANX_PROTECTION_NONE, &alpha, 0 /*clamp*/, DISPMANX_NO_ROTATE); nativewindow.element = dispman_element; nativewindow.width = g_fb_width; diff --git a/gfx/gl.c b/gfx/gl.c index 546b34bc29..6ed39fc0c9 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -610,6 +610,11 @@ void gl_set_viewport(gl_t *gl, unsigned width, unsigned height, bool force_full, { float desired_aspect = g_settings.video.aspect_ratio; float device_aspect = (float)width / height; + + // check for SD televisions: they should always be 4:3 + if ((width == 640 || width == 720) && (height == 480 || height == 576)) + device_aspect = 4.0f / 3.0f; + float delta; #ifdef RARCH_CONSOLE