SDL_RenderCopyEx
使用该函数复制材质图像的一部分至当前的渲染目标,可以按一定的角度按指定旋转中心旋转或上下/左右翻转。
Syntax 语法
int SDL_RenderCopyEx(SDL_Renderer* renderer,
SDL_Texture* texture,
const SDL_Rect* srcrect,
const SDL_Rect* dstrect,
const double angle,
const SDL_Point* center,
const SDL_RendererFlip flip)
Function Parameters 函数参数
renderer | the rendering context 渲染器 |
texture | the source texture; see Remarks for details 源材质,详细请看注释。 |
srcrect | the source SDL_Rect structure or NULL for the entire texture SDL_Rect 结构体指定的要复制的源材质的矩形区域或者 NULL 为整个材质图像。 |
dstrect | the destination SDL_Rect structure or NULL for the entire rendering target SDL_Rect 结构体指定的目标矩形区域或者 NULL 为渲染器的整个区域。 |
angle | an angle in degrees that indicates the rotation that will be applied to dstrect 旋转角度(角度制) |
center | a pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2) 旋转中心,如果指定 NULL 则为材质图像的中心。 |
flip | a SDL_RendererFlip value stating which flipping actions should be performed on the texture 指定翻转参数。 |
Return Value 返回值
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
成功返回 0, 否则返回一个负数的错误码;调用 SDL_GetError() 获取更多信息。
Code Examples 代码示例
暂无。
Remarks 注释
The texture is blended with the destination based on its blend mode set with SDL_SetTextureBlendMode().
渲染后的材质根据 SDL_SetTextureBlendMode() 的设置会带有混合效果。
The texture color is affected based on its color modulation set by SDL_SetTextureColorMod().
材质的颜色是受 SDL_SetTextureColorMod() 影响的。
The texture alpha is affected based on its alpha modulation set by SDL_SetTextureAlphaMod().
材质的透明度是受 SDL_SetTextureAlphaMod() 影响的。
Related Functions 相关函数
SDL_RenderCopy
SDL_SetTextureAlphaMod
SDL_SetTextureBlendMode
SDL_SetTextureColorMod