本篇介绍用到的结构体
1.SDL_PixelFormat
Uint32 format 一个枚举值one of the SDL_PixelFormatEnum values
SDL_Palette* palette 和像素相关的调色板an SDL_Palette structure associated with this pixel format, or NULL if the format doesn’t have a palette
Uint8 BitsPerPixel 像素值中有意义的位the number of significant bits in a pixel value, eg: 8, 15, 16, 24, 32
Uint8 BytesPerPixel 保存像素值所需的字节数the number of bytes required to hold a pixel value, eg: 1, 2, 3, 4; see Remarks for related data type
Uint32 Rmask 一种掩码,表示像素的红色部分的位置a mask representing the location of the red component of the pixel
Uint32 Gmask 一种掩码,表示像素的绿色部分的位置a mask representing the location of the green component of the pixel
Uint32 Bmask 一种掩码,表示像素的蓝色部分的位置a mask representing the location of the blue component of the pixel
Uint32 Amask 表示像素的alpha组件位置的掩码,如果像素格式没有任何alpha信息,则为0a mask representing the location of the alpha component of the pixel or 0 if the pixel format doesn’t have any alpha information
2.SDL_Palette
调色板信息的结构体
成员:
int ncolors 调色板上颜色的数目the number of colors in the palette
SDL_Color* colors 代表调色板的SDL_Color结构数组an array of SDL_Color structures representing the palette
3.SDL_Color
代表一种颜色的结构体
成员:
Uint8 r 红the red component in the range 0-255
Uint8 g 绿the green component in the range 0-255
Uint8 b 蓝the blue component in the range 0-255
Uint8 a the alpha component in the range 0-255
SDL2函数简单介绍06
最新推荐文章于 2022-05-06 11:12:11 发布