|
Size: 1333
Comment: create page, add content
|
Size: 1471
Comment: update content - pointers, structs
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 11: | Line 11: |
| int SDL_RenderCopy(SDL_TextureID textureID, | int SDL_RenderCopy(SDL_Texture* texture, |
| Line 17: | Line 17: |
| ||'''textureID'''||the source texture; see [[#textureID|Remarks]] for details|| ||'''srcrect'''||a pointer to the source rectangle, or NULL for the entire texture|| ||'''dstrect'''||a pointer to the destination rectangle, or NULL for the entire rendering target|| |
||'''texture'''||the source SDL_Texture; see [[#Remarks|Remarks]] for details|| ||'''srcrect'''||the source [[SDL_Rect]] or NULL for the entire texture|| ||'''dstrect'''||the destination [[SDL_Rect]] or NULL for the entire rendering target|| |
| Line 22: | Line 22: |
| Returns 0 on success, or -1 if there is no rendering context current or the driver doesn't support the requested operation; call [[SDL_GetError]]() for more information. |
Returns 0 on success or a negative error code on failure; call [[SDL_GetError]]() for more information. <<Color2(purple,If there is no rendering context current or the driver doesn't support the requested operation it returns -1.)>> |
| Line 31: | Line 32: |
| <<Anchor(textureID)>> The texture channel modulation is provided by the enumeration [[SDL_TextureModulate]] using these flags: <<Include(SDL_TextureModulate, , , from="== Values ==", to="== Code Examples ==")>> |
The texture is blended with the destination based on its blend mode set with [[SDL_SetTextureBlendMode]](). The texture color is affected based on its color modulation set by [[SDL_SetTextureColorMod]](). The texture alpha is affected based on its alpha modulation set by [[SDL_SetTextureAlphaMod]](). |
| Line 35: | Line 39: |
| .[[SDL_RenderLines]] .[[SDL_RenderPoints]] .[[SDL_RenderRect]] .[[SDL_RenderRects]] |
.[[SDL_SetTextureAlphaMod]] .[[SDL_SetTextureBlendMode]] .[[SDL_SetTextureColorMod]] |
SDL_RenderCopy
Use this function to copy a portion of the texture to the current rendering target.
Contents
Syntax
int SDL_RenderCopy(SDL_Texture* texture,
const SDL_Rect* srcrect,
const SDL_Rect* dstrect)
Function Parameters
texture |
the source SDL_Texture; see Remarks for details |
srcrect |
the source SDL_Rect or NULL for the entire texture |
dstrect |
the destination SDL_Rect or NULL for the entire rendering target |
Return Value
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
purple
Code Examples
You can add your code example here
Remarks
The texture is blended with the destination based on its blend mode set with SDL_SetTextureBlendMode().
The texture color is affected based on its color modulation set by SDL_SetTextureColorMod().
The texture alpha is affected based on its alpha modulation set by SDL_SetTextureAlphaMod().
