SDL_RenderCopyEx

使用该函数复制材质图像的一部分至当前的渲染目标,可以按一定的角度按指定旋转中心旋转或上下/左右翻转。

Syntax 语法

  1. int SDL_RenderCopyEx(SDL_Renderer* renderer,
  2. SDL_Texture* texture,
  3. const SDL_Rect* srcrect,
  4. const SDL_Rect* dstrect,
  5. const double angle,
  6. const SDL_Point* center,
  7. const SDL_RendererFlip flip)

Function Parameters 函数参数

rendererthe rendering context
渲染器
texturethe source texture; see Remarks for details
源材质,详细请看注释
srcrectthe source SDL_Rect structure or NULL for the entire texture
SDL_Rect 结构体指定的要复制的源材质的矩形区域或者 NULL 为整个材质图像。
dstrectthe destination SDL_Rect structure or NULL for the entire rendering target
SDL_Rect 结构体指定的目标矩形区域或者 NULL 为渲染器的整个区域。
anglean angle in degrees that indicates the rotation that will be applied to dstrect
旋转角度(角度制)
centera 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 则为材质图像的中心。
flipa 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 代码示例

  1. 暂无。

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


@lxfly2000