Module Documentation
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
193
11.29
CWindow
Data Structures
class CWindow
class CSurfaceWindow< NUM_BUFFERS >
class CStaticSurfaceWindow
11.29.1 Detailed Description
The class CWindow can be used to open a window with the 2D core driver. The header file contains different
derived classed for different use cases. For instance a CSurfaceWindow<2> object can be used to manage a double
buffered render target that will be displayed as a window layer on the connected panel. A CStaticSurfaceWindow
object can be used as a static background layer or to display a static icon as foreground window. The typical use or
these CWindows object will be shown in the following sample:
void
main()
{
CDevice device;
CDisplay display;
CStaticSurfaceWindow wndBg;
CSurfaceWindow<2> wndRender;
//open device
device.Open();
// open display
display.Open(ScreenWidth, ScreenHeight);
// open a background window and assign an image
wndBg.Open(display, background_image);
// open a foreground window with alpha blending
wndRender.Open(display, 0, 0, ScreenWidth, ScreenHeight, MML_GDC_DISP_LAYER_1,
MML_GDC_DISP_SUB_LAYER_DEFAULT, 0, MML_GDC_DISP_BLEND_SOURCE_ALPHA);
//create a (double) buffer for the window
wndRender.CreateBuffer();
while
(draw)
{
// render something to wndRender.m_surface
...
//swap the buffers
wndRender.Swap();
}
}