IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    [原]SDL_CreateRGBSurface函数

    caimouse发表于 2016-12-06 09:33:25
    love 0

    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;
    		}



    跟老菜鸟学python




沪ICP备19023445号-2号
友情链接