SDL_CreateRGBSurface函数:
用此函数来创建一个新的RGB表面。
SDL_Surface* SDL_CreateRGBSurface(Uint32 flags,
int width,
int height,
int depth,
Uint32 Rmask,
Uint32 Gmask,
Uint32 Bmask,
Uint32 Amask)
参数说明:
flags | the flags are unused and should be set to 0 |
width | the width of the surface |
height | the height of the surface |
depth | the depth of the surface in bits; see Remarks for details |
Rmask | the red mask for the pixels |
Gmask | the green mask for the pixels |
Bmask | the blue mask for the pixels |
Amask | the alpha mask for the pixels |
例子:
//
// 保存屏幕将要被使用的部分
//
save = SDL_CreateRGBSurface(gpScreen->flags, rect.w, rect.h, 8,
gpScreen->format->Rmask, gpScreen->format->Gmask,
gpScreen->format->Bmask, gpScreen->format->Amask);
if (save == NULL)
{
return NULL;
}