Hi,
I'm experiencing some isues trying to implement a 2 graphics layers.
I have developed the whole project with 1 graphic layer and 2 framebuffers and with emwin graphical stack (switching between them with "GUI_MULTIBUF_Begin" and "GUI_MULTIBUF_End"). Now I'm trying to implement a second graphic layer. When the projects starts with two layers nothing is displayed on the TFT.
With 1 Graphic layer and 2 framebuffers the memory distributions is as follows:
The microcontroller displays fb_background[0] and the emWin graphic instructions are visible on TFT.
With 2 graphics layers and 3 framebuffers (2 for the first layer and 1 for the second) the memory distribution is as follows:
The microcontroller displays fb_foreground[0] and the emWin graphic instructions are NOT visible on TFT.
Only if I call to "R_GLCDC_LayerChange(&g_display0_ctrl, &g_display0_cfg, 1);" after GUI_INIT() the emWin instructions draw something on displayed framebuffer.
As you can notice the TFT is a 480x272 pixels, so taking account I'm using 4 channels color codification (A,R,G,B) there's a size used of 522240 bytes (== 0x7F800) per each framebuffer. It makes sense. I'm running this on a custom board. I have an external SDRAM so it is not because of a lack of storage (it is a 32Mb SDRAM).
Does this behavior make sense? Shouldn't it still displaying on TFT the fb_background[0] framebuffer as before? Do you have a project example that switchs between graphic layers and framebuffers succesfully?
Thank you in advance.
Hello and sorry for the delay,
Could you share your project either here or as a private message to test on my device ?
Yes, no problem. Please let me implement a multilayer example provided by emWin on a new EK-RA6M3G project in order to share it with you.
Hi again,
Test_MultiLayer_MultiBuffer_EK_RA6M3G.zip
Please find attached the example project. The attached project implements a 2 graphical layers following the emWin layers example explained in emWin User's Manual (12.2.1):
The expected result is the layer 0 and the layer 1 are blended and the graphics displayed are as the above example shows. But instead of that, I'm experiencing that the layer 0 (fb_background) and the layer 1 (fb_foreground) has the same graphics.
P.S: I tried to implement a double buffer for each layer but that is not possible since EK-RA6M3G does not has enough SDRAM to manage that. Maybe to do that it will be needed to use the M13 Design's RA6M3 PCB which implements an external SDRAM. But first let's focus on implement succesfully a two-layers example if you agree.
Do you know how to properly manage he layers when emWin graphics stack is used?
Best wishes,
I think you have confused GLCDC Layer 1 or 2 with the layers as defined by emWin.
From what you are saying I understand you are trying make an object transparent so it inherits its color from the layer underneath. This does not require 2 GLCDC layers but 2 layers of emWin.
Please find the project modified to achieve this.
EK_RA6M3_emWin_transparency.zip
Layer 1 and layer 2 of emWin have the same objects. The objects of layer 2 are transparent and get the color of the objects on layer 1.
It is important that you call GUI_EnableAlpha(1); Please refer to 12.2 Using MultiLayer support on https://www.segger.com/downloads/emwin/UM03001
For more emWin related questions please contact Segger.
You actually manage to get the desired graphics because you draw the same on each layer but I think the graphics layers are not combined properly.
For further doubts concerning emWin subjects I will contact Segger. But since GLCDC is a Renesas controller, could you please share an example which uses 2 GLCDC layers?
Thanks in advance.
I have enabled the layer 2 on the Graphics example. The framebuffer is not filled so there is only a black rectangular on top of layer 1.
Graphics_App_EK_RA6M3.zip