Tutorial
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
48
6.7 Tutorial: Display_Extended
6.7.1 Description
Figure 18. DisplayExtended
The focus of Display_Extended is the synchronization of blit and buffer swap operations.
Open multiple windows on the display and prepare double buffering.
Trigger simple render operations and buffer swaps for each window.
Use different swap intervals for windows.
6.7.2 Setup
The initialization routine opens the display controller. Then it opens any vertical arranged windows. Each window
prepares
2 frame buffers that will be used as foreground and background buffer.
A blit context.
And a sync object.
A structure for each window keeps all important variables to control the window:
struct
DOUBLE_BUFFERED_WINDOW{
MML_GDC_DISP_WINDOW win;
// the window handle
MML_GDC_SURFACE_CONTAINER sFramebuffer[2];
// two buffers described in surface objects.
MML_GDC_SYNC_CONTAINER sync;
// a sync object used
MML_GDC_PE_CONTEXT_CONTAINER ctx;
// context for drawing
MM_U08 id;
// an id storing which buffer is currently the foreground buffer
MM_FLOAT fRot;
// a draw related parameter
};
The final step for each window is getting a sync object of the window pipe. This sync object can be used to detect if
the OpenWindow call is finished in the HW.