aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2014-09-30 18:22:21 +0200
committerRay <raysan5@gmail.com>2014-09-30 18:22:21 +0200
commit063e26c521dba1af582906df1e5b96fa37c82a16 (patch)
tree02bfbf6c0c73adebf2fcd15cbd7e7077ba03fd42
parent9b5e66f5ea480bb701bec2a6fa0ba8e413c37e19 (diff)
downloadraylib-063e26c521dba1af582906df1e5b96fa37c82a16.tar.gz
raylib-063e26c521dba1af582906df1e5b96fa37c82a16.zip
Corrected issue with transparent surface in Raspberry Pi
-rw-r--r--src/core.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core.c b/src/core.c
index abd60524..d4919960 100644
--- a/src/core.c
+++ b/src/core.c
@@ -106,7 +106,7 @@ static GLFWwindow *window; // Native window (graphic device
#elif defined(PLATFORM_ANDROID)
static struct android_app *app; // Android activity
static struct android_poll_source *source; // Android events polling source
-static int ident, events;
+static int ident, events;
static bool windowReady = false; // Used to detect display initialization
// Gestures detection variables
@@ -965,6 +965,7 @@ static void InitDisplay(int width, int height)
DISPMANX_ELEMENT_HANDLE_T dispmanElement;
DISPMANX_DISPLAY_HANDLE_T dispmanDisplay;
DISPMANX_UPDATE_HANDLE_T dispmanUpdate;
+
VC_RECT_T dstRect;
VC_RECT_T srcRect;
#endif
@@ -1049,11 +1050,16 @@ static void InitDisplay(int width, int height)
// NOTE: RPI dispmanx windowing system takes care of srcRec scaling to dstRec by hardware (no cost)
// Take care that renderWidth/renderHeight fit on displayWidth/displayHeight aspect ratio
- dispmanDisplay = vc_dispmanx_display_open(0);
+ VC_DISPMANX_ALPHA_T alpha;
+ alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS;
+ alpha.opacity = 255;
+ alpha.mask = 0;
+
+ dispmanDisplay = vc_dispmanx_display_open(0); // LCD
dispmanUpdate = vc_dispmanx_update_start(0);
dispmanElement = vc_dispmanx_element_add(dispmanUpdate, dispmanDisplay, 0/*layer*/, &dstRect, 0/*src*/,
- &srcRect, DISPMANX_PROTECTION_NONE, 0/*alpha*/, 0/*clamp*/, 0/*transform*/);
+ &srcRect, DISPMANX_PROTECTION_NONE, &alpha, 0/*clamp*/, DISPMANX_NO_ROTATE);
nativeWindow.element = dispmanElement;
nativeWindow.width = renderWidth;