Module Documentation
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
190
11.28
CSurface
Data Structures
class CSurface< NUM_BUFFERS >
Functions
CSurface ()
void Init ()
MM_ERROR Delete ()
virtual MM_ERROR CreateBuffer (const MM_U32 width, const MM_U32 height, const
MML_GDC_SURF_FORMAT format=MML_GDC_SURF_FORMAT_R8G8B8A8, MM_U32 MaxSize=0)
virtual MM_ERROR CreateBuffer (const MM_U32 width, const MM_U32 height, MM_U32 bit_red, MM_U32
bit_green, MM_U32 bit_blue, MM_U32 bit_alpha)
virtual MM_ERROR CreateGrayBuffer (const MM_U32 width, const MM_U32 height, MM_U32 bit_color,
MM_U32 bit_alpha)
virtual MM_ERROR SurfLoadBitmap (const void
∗
pImage, MM_BOOL bCopyToVRAM=MM_FALSE)
virtual MM_ERROR Copy (MML_GDC_SURFACE surface)
11.28.1 Detailed Description
The class CSurface is a abstraction of one or more MML_GDC_SURFACE objects depending on the
NUM_BUFFERS definition. The constructor takes over the surface object initialization. To use the surface for blit or
display operations it is typically required to allocate VRAM or to assign a static resource from FLASH memory. The
required functions are part of these class.
If the NUM_BUFFERS is 2 (or more), the CSurface object can be used for multi buffer rendering. The Swap member
function can be used to toggle between foreground and background buffer. The GetSurface, GetHandle and
[]operator will always return the foreground buffer.
11.28.2 Function Documentation
11.28.2.1 MM_ERROR Copy ( MML_GDC_SURFACE surface ) [virtual]
Copy the surface object.
Note:
This function copies the properties only. Not the surface content of surface object.
Parameters
in
surface
Surface that should be copied.
Return values
MML_OK
on success. Otherwise the related error code.