Lines Matching refs:texture

45 #define CHECK_TEXTURE_MAGIC(texture, retval) \  argument
46 SDL_assert(texture && texture->magic == &texture_magic); \
47 if (!texture || texture->magic != &texture_magic) { \
190 (int) cmd->data.draw.blend, cmd->data.draw.texture); in DebugLogRenderCommands()
200 (int) cmd->data.draw.blend, cmd->data.draw.texture); in DebugLogRenderCommands()
240 FlushRenderCommandsIfTextureNeeded(SDL_Texture *texture) in FlushRenderCommandsIfTextureNeeded() argument
242 SDL_Renderer *renderer = texture->renderer; in FlushRenderCommandsIfTextureNeeded()
243 if (texture->last_command_generation == renderer->render_command_generation) { in FlushRenderCommandsIfTextureNeeded()
448 cmd->data.draw.texture = NULL; /* no texture. */ in PrepQueueCmdDrawSolid()
497 PrepQueueCmdDrawTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_RenderCommandType c… in PrepQueueCmdDrawTexture() argument
501 if (PrepQueueCmdDraw(renderer, texture->r, texture->g, texture->b, texture->a) == 0) { in PrepQueueCmdDrawTexture()
507 cmd->data.draw.r = texture->r; in PrepQueueCmdDrawTexture()
508 cmd->data.draw.g = texture->g; in PrepQueueCmdDrawTexture()
509 cmd->data.draw.b = texture->b; in PrepQueueCmdDrawTexture()
510 cmd->data.draw.a = texture->a; in PrepQueueCmdDrawTexture()
511 cmd->data.draw.blend = texture->blendMode; in PrepQueueCmdDrawTexture()
512 cmd->data.draw.texture = texture; in PrepQueueCmdDrawTexture()
519 QueueCmdCopy(SDL_Renderer *renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_FRe… in QueueCmdCopy() argument
521 SDL_RenderCommand *cmd = PrepQueueCmdDrawTexture(renderer, texture, SDL_RENDERCMD_COPY); in QueueCmdCopy()
524 retval = renderer->QueueCopy(renderer, cmd, texture, srcrect, dstrect); in QueueCmdCopy()
533 QueueCmdCopyEx(SDL_Renderer *renderer, SDL_Texture * texture, in QueueCmdCopyEx() argument
537 SDL_RenderCommand *cmd = PrepQueueCmdDrawTexture(renderer, texture, SDL_RENDERCMD_COPY_EX); in QueueCmdCopyEx()
541 … retval = renderer->QueueCopyEx(renderer, cmd, texture, srcquad, dstrect, angle, center, flip); in QueueCmdCopyEx()
1049 SDL_Texture *texture; in SDL_CreateTexture() local
1073 texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture)); in SDL_CreateTexture()
1074 if (!texture) { in SDL_CreateTexture()
1078 texture->magic = &texture_magic; in SDL_CreateTexture()
1079 texture->format = format; in SDL_CreateTexture()
1080 texture->access = access; in SDL_CreateTexture()
1081 texture->w = w; in SDL_CreateTexture()
1082 texture->h = h; in SDL_CreateTexture()
1083 texture->r = 255; in SDL_CreateTexture()
1084 texture->g = 255; in SDL_CreateTexture()
1085 texture->b = 255; in SDL_CreateTexture()
1086 texture->a = 255; in SDL_CreateTexture()
1087 texture->scaleMode = SDL_GetScaleMode(); in SDL_CreateTexture()
1088 texture->renderer = renderer; in SDL_CreateTexture()
1089 texture->next = renderer->textures; in SDL_CreateTexture()
1091 renderer->textures->prev = texture; in SDL_CreateTexture()
1093 renderer->textures = texture; in SDL_CreateTexture()
1096 if (renderer->CreateTexture(renderer, texture) < 0) { in SDL_CreateTexture()
1097 SDL_DestroyTexture(texture); in SDL_CreateTexture()
1101 texture->native = SDL_CreateTexture(renderer, in SDL_CreateTexture()
1104 if (!texture->native) { in SDL_CreateTexture()
1105 SDL_DestroyTexture(texture); in SDL_CreateTexture()
1110 texture->native->next = texture->next; in SDL_CreateTexture()
1111 if (texture->native->next) { in SDL_CreateTexture()
1112 texture->native->next->prev = texture->native; in SDL_CreateTexture()
1114 texture->prev = texture->native->prev; in SDL_CreateTexture()
1115 if (texture->prev) { in SDL_CreateTexture()
1116 texture->prev->next = texture; in SDL_CreateTexture()
1118 texture->native->prev = texture; in SDL_CreateTexture()
1119 texture->next = texture->native; in SDL_CreateTexture()
1120 renderer->textures = texture; in SDL_CreateTexture()
1122 if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { in SDL_CreateTexture()
1124 texture->yuv = SDL_SW_CreateYUVTexture(format, w, h); in SDL_CreateTexture()
1128 if (!texture->yuv) { in SDL_CreateTexture()
1129 SDL_DestroyTexture(texture); in SDL_CreateTexture()
1134 texture->pitch = (((w * SDL_BYTESPERPIXEL(format)) + 3) & ~3); in SDL_CreateTexture()
1135 texture->pixels = SDL_calloc(1, texture->pitch * h); in SDL_CreateTexture()
1136 if (!texture->pixels) { in SDL_CreateTexture()
1137 SDL_DestroyTexture(texture); in SDL_CreateTexture()
1142 return texture; in SDL_CreateTexture()
1153 SDL_Texture *texture; in SDL_CreateTextureFromSurface() local
1219 texture = SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_STATIC, in SDL_CreateTextureFromSurface()
1221 if (!texture) { in SDL_CreateTextureFromSurface()
1242 SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch); in SDL_CreateTextureFromSurface()
1245 SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch); in SDL_CreateTextureFromSurface()
1254 SDL_DestroyTexture(texture); in SDL_CreateTextureFromSurface()
1260 SDL_UpdateTexture(texture, NULL, temp->pixels, temp->pitch); in SDL_CreateTextureFromSurface()
1263 SDL_DestroyTexture(texture); in SDL_CreateTextureFromSurface()
1273 SDL_SetTextureColorMod(texture, r, g, b); in SDL_CreateTextureFromSurface()
1276 SDL_SetTextureAlphaMod(texture, a); in SDL_CreateTextureFromSurface()
1280 SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); in SDL_CreateTextureFromSurface()
1283 SDL_SetTextureBlendMode(texture, blendMode); in SDL_CreateTextureFromSurface()
1286 return texture; in SDL_CreateTextureFromSurface()
1290 SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access, in SDL_QueryTexture() argument
1293 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_QueryTexture()
1296 *format = texture->format; in SDL_QueryTexture()
1299 *access = texture->access; in SDL_QueryTexture()
1302 *w = texture->w; in SDL_QueryTexture()
1305 *h = texture->h; in SDL_QueryTexture()
1311 SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b) in SDL_SetTextureColorMod() argument
1313 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_SetTextureColorMod()
1316 texture->modMode |= SDL_TEXTUREMODULATE_COLOR; in SDL_SetTextureColorMod()
1318 texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR; in SDL_SetTextureColorMod()
1320 texture->r = r; in SDL_SetTextureColorMod()
1321 texture->g = g; in SDL_SetTextureColorMod()
1322 texture->b = b; in SDL_SetTextureColorMod()
1323 if (texture->native) { in SDL_SetTextureColorMod()
1324 return SDL_SetTextureColorMod(texture->native, r, g, b); in SDL_SetTextureColorMod()
1330 SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g, in SDL_GetTextureColorMod() argument
1333 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_GetTextureColorMod()
1336 *r = texture->r; in SDL_GetTextureColorMod()
1339 *g = texture->g; in SDL_GetTextureColorMod()
1342 *b = texture->b; in SDL_GetTextureColorMod()
1348 SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha) in SDL_SetTextureAlphaMod() argument
1350 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_SetTextureAlphaMod()
1353 texture->modMode |= SDL_TEXTUREMODULATE_ALPHA; in SDL_SetTextureAlphaMod()
1355 texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA; in SDL_SetTextureAlphaMod()
1357 texture->a = alpha; in SDL_SetTextureAlphaMod()
1358 if (texture->native) { in SDL_SetTextureAlphaMod()
1359 return SDL_SetTextureAlphaMod(texture->native, alpha); in SDL_SetTextureAlphaMod()
1365 SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha) in SDL_GetTextureAlphaMod() argument
1367 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_GetTextureAlphaMod()
1370 *alpha = texture->a; in SDL_GetTextureAlphaMod()
1376 SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode) in SDL_SetTextureBlendMode() argument
1380 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_SetTextureBlendMode()
1382 renderer = texture->renderer; in SDL_SetTextureBlendMode()
1386 texture->blendMode = blendMode; in SDL_SetTextureBlendMode()
1387 if (texture->native) { in SDL_SetTextureBlendMode()
1388 return SDL_SetTextureBlendMode(texture->native, blendMode); in SDL_SetTextureBlendMode()
1394 SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode) in SDL_GetTextureBlendMode() argument
1396 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_GetTextureBlendMode()
1399 *blendMode = texture->blendMode; in SDL_GetTextureBlendMode()
1405 SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode) in SDL_SetTextureScaleMode() argument
1409 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_SetTextureScaleMode()
1411 renderer = texture->renderer; in SDL_SetTextureScaleMode()
1412 renderer->SetTextureScaleMode(renderer, texture, scaleMode); in SDL_SetTextureScaleMode()
1413 texture->scaleMode = scaleMode; in SDL_SetTextureScaleMode()
1414 if (texture->native) { in SDL_SetTextureScaleMode()
1415 return SDL_SetTextureScaleMode(texture->native, scaleMode); in SDL_SetTextureScaleMode()
1421 SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode) in SDL_GetTextureScaleMode() argument
1423 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_GetTextureScaleMode()
1426 *scaleMode = texture->scaleMode; in SDL_GetTextureScaleMode()
1433 SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect, in SDL_UpdateTextureYUV() argument
1436 SDL_Texture *native = texture->native; in SDL_UpdateTextureYUV()
1439 if (SDL_SW_UpdateYUVTexture(texture->yuv, rect, pixels, pitch) < 0) { in SDL_UpdateTextureYUV()
1445 full_rect.w = texture->w; in SDL_UpdateTextureYUV()
1446 full_rect.h = texture->h; in SDL_UpdateTextureYUV()
1449 if (texture->access == SDL_TEXTUREACCESS_STREAMING) { in SDL_UpdateTextureYUV()
1457 SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format, in SDL_UpdateTextureYUV()
1469 SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format, in SDL_UpdateTextureYUV()
1480 SDL_UpdateTextureNative(SDL_Texture * texture, const SDL_Rect * rect, in SDL_UpdateTextureNative() argument
1483 SDL_Texture *native = texture->native; in SDL_UpdateTextureNative()
1489 if (texture->access == SDL_TEXTUREACCESS_STREAMING) { in SDL_UpdateTextureNative()
1498 texture->format, pixels, pitch, in SDL_UpdateTextureNative()
1511 texture->format, pixels, pitch, in SDL_UpdateTextureNative()
1521 SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, in SDL_UpdateTexture() argument
1526 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_UpdateTexture()
1538 full_rect.w = texture->w; in SDL_UpdateTexture()
1539 full_rect.h = texture->h; in SDL_UpdateTexture()
1546 } else if (texture->yuv) { in SDL_UpdateTexture()
1547 return SDL_UpdateTextureYUV(texture, rect, pixels, pitch); in SDL_UpdateTexture()
1549 } else if (texture->native) { in SDL_UpdateTexture()
1550 return SDL_UpdateTextureNative(texture, rect, pixels, pitch); in SDL_UpdateTexture()
1552 SDL_Renderer *renderer = texture->renderer; in SDL_UpdateTexture()
1553 if (FlushRenderCommandsIfTextureNeeded(texture) < 0) { in SDL_UpdateTexture()
1556 return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch); in SDL_UpdateTexture()
1562 SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect, in SDL_UpdateTextureYUVPlanar() argument
1567 SDL_Texture *native = texture->native; in SDL_UpdateTextureYUVPlanar()
1570 …if (SDL_SW_UpdateYUVTexturePlanar(texture->yuv, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpit… in SDL_UpdateTextureYUVPlanar()
1576 full_rect.w = texture->w; in SDL_UpdateTextureYUVPlanar()
1577 full_rect.h = texture->h; in SDL_UpdateTextureYUVPlanar()
1584 if (texture->access == SDL_TEXTUREACCESS_STREAMING) { in SDL_UpdateTextureYUVPlanar()
1592 SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format, in SDL_UpdateTextureYUVPlanar()
1604 SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format, in SDL_UpdateTextureYUVPlanar()
1614 int SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect, in SDL_UpdateYUVTexture() argument
1623 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_UpdateYUVTexture()
1644 if (texture->format != SDL_PIXELFORMAT_YV12 && in SDL_UpdateYUVTexture()
1645 texture->format != SDL_PIXELFORMAT_IYUV) { in SDL_UpdateYUVTexture()
1652 full_rect.w = texture->w; in SDL_UpdateYUVTexture()
1653 full_rect.h = texture->h; in SDL_UpdateYUVTexture()
1661 if (texture->yuv) { in SDL_UpdateYUVTexture()
1662 … return SDL_UpdateTextureYUVPlanar(texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch); in SDL_UpdateYUVTexture()
1664 SDL_assert(!texture->native); in SDL_UpdateYUVTexture()
1665 renderer = texture->renderer; in SDL_UpdateYUVTexture()
1668 if (FlushRenderCommandsIfTextureNeeded(texture) < 0) { in SDL_UpdateYUVTexture()
1671 …return renderer->UpdateTextureYUV(renderer, texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane,… in SDL_UpdateYUVTexture()
1683 SDL_LockTextureYUV(SDL_Texture * texture, const SDL_Rect * rect, in SDL_LockTextureYUV() argument
1686 return SDL_SW_LockYUVTexture(texture->yuv, rect, pixels, pitch); in SDL_LockTextureYUV()
1691 SDL_LockTextureNative(SDL_Texture * texture, const SDL_Rect * rect, in SDL_LockTextureNative() argument
1694 texture->locked_rect = *rect; in SDL_LockTextureNative()
1695 *pixels = (void *) ((Uint8 *) texture->pixels + in SDL_LockTextureNative()
1696 rect->y * texture->pitch + in SDL_LockTextureNative()
1697 rect->x * SDL_BYTESPERPIXEL(texture->format)); in SDL_LockTextureNative()
1698 *pitch = texture->pitch; in SDL_LockTextureNative()
1703 SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect, in SDL_LockTexture() argument
1708 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_LockTexture()
1710 if (texture->access != SDL_TEXTUREACCESS_STREAMING) { in SDL_LockTexture()
1717 full_rect.w = texture->w; in SDL_LockTexture()
1718 full_rect.h = texture->h; in SDL_LockTexture()
1723 if (texture->yuv) { in SDL_LockTexture()
1724 if (FlushRenderCommandsIfTextureNeeded(texture) < 0) { in SDL_LockTexture()
1727 return SDL_LockTextureYUV(texture, rect, pixels, pitch); in SDL_LockTexture()
1730 if (texture->native) { in SDL_LockTexture()
1732 return SDL_LockTextureNative(texture, rect, pixels, pitch); in SDL_LockTexture()
1734 SDL_Renderer *renderer = texture->renderer; in SDL_LockTexture()
1735 if (FlushRenderCommandsIfTextureNeeded(texture) < 0) { in SDL_LockTexture()
1738 return renderer->LockTexture(renderer, texture, rect, pixels, pitch); in SDL_LockTexture()
1743 SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, in SDL_LockTextureToSurface() argument
1751 if (texture == NULL || surface == NULL) { in SDL_LockTextureToSurface()
1757 real_rect.w = texture->w; in SDL_LockTextureToSurface()
1758 real_rect.h = texture->h; in SDL_LockTextureToSurface()
1764 ret = SDL_LockTexture(texture, &real_rect, &pixels, &pitch); in SDL_LockTextureToSurface()
1769texture->locked_surface = SDL_CreateRGBSurfaceWithFormatFrom(pixels, real_rect.w, real_rect.h, 0, … in SDL_LockTextureToSurface()
1770 if (texture->locked_surface == NULL) { in SDL_LockTextureToSurface()
1771 SDL_UnlockTexture(texture); in SDL_LockTextureToSurface()
1775 *surface = texture->locked_surface; in SDL_LockTextureToSurface()
1781 SDL_UnlockTextureYUV(SDL_Texture * texture) in SDL_UnlockTextureYUV() argument
1783 SDL_Texture *native = texture->native; in SDL_UnlockTextureYUV()
1790 rect.w = texture->w; in SDL_UnlockTextureYUV()
1791 rect.h = texture->h; in SDL_UnlockTextureYUV()
1796 SDL_SW_CopyYUVToRGB(texture->yuv, &rect, native->format, in SDL_UnlockTextureYUV()
1803 SDL_UnlockTextureNative(SDL_Texture * texture) in SDL_UnlockTextureNative() argument
1805 SDL_Texture *native = texture->native; in SDL_UnlockTextureNative()
1808 const SDL_Rect *rect = &texture->locked_rect; in SDL_UnlockTextureNative()
1809 const void* pixels = (void *) ((Uint8 *) texture->pixels + in SDL_UnlockTextureNative()
1810 rect->y * texture->pitch + in SDL_UnlockTextureNative()
1811 rect->x * SDL_BYTESPERPIXEL(texture->format)); in SDL_UnlockTextureNative()
1812 int pitch = texture->pitch; in SDL_UnlockTextureNative()
1818 texture->format, pixels, pitch, in SDL_UnlockTextureNative()
1824 SDL_UnlockTexture(SDL_Texture * texture) in SDL_UnlockTexture() argument
1826 CHECK_TEXTURE_MAGIC(texture, ); in SDL_UnlockTexture()
1828 if (texture->access != SDL_TEXTUREACCESS_STREAMING) { in SDL_UnlockTexture()
1832 if (texture->yuv) { in SDL_UnlockTexture()
1833 SDL_UnlockTextureYUV(texture); in SDL_UnlockTexture()
1836 if (texture->native) { in SDL_UnlockTexture()
1837 SDL_UnlockTextureNative(texture); in SDL_UnlockTexture()
1839 SDL_Renderer *renderer = texture->renderer; in SDL_UnlockTexture()
1840 renderer->UnlockTexture(renderer, texture); in SDL_UnlockTexture()
1843 SDL_FreeSurface(texture->locked_surface); in SDL_UnlockTexture()
1844 texture->locked_surface = NULL; in SDL_UnlockTexture()
1857 SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) in SDL_SetRenderTarget() argument
1862 if (texture == renderer->target) { in SDL_SetRenderTarget()
1870 if (texture) { in SDL_SetRenderTarget()
1871 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_SetRenderTarget()
1872 if (renderer != texture->renderer) { in SDL_SetRenderTarget()
1875 if (texture->access != SDL_TEXTUREACCESS_TARGET) { in SDL_SetRenderTarget()
1878 if (texture->native) { in SDL_SetRenderTarget()
1880 texture = texture->native; in SDL_SetRenderTarget()
1886 if (texture && !renderer->target) { in SDL_SetRenderTarget()
1895 renderer->target = texture; in SDL_SetRenderTarget()
1897 if (renderer->SetRenderTarget(renderer, texture) < 0) { in SDL_SetRenderTarget()
1902 if (texture) { in SDL_SetRenderTarget()
1905 renderer->viewport.w = texture->w; in SDL_SetRenderTarget()
1906 renderer->viewport.h = texture->h; in SDL_SetRenderTarget()
1911 renderer->logical_w = texture->w; in SDL_SetRenderTarget()
1912 renderer->logical_h = texture->h; in SDL_SetRenderTarget()
2932 SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, in SDL_RenderCopy() argument
2944 return SDL_RenderCopyF(renderer, texture, srcrect, pdstfrect); in SDL_RenderCopy()
2948 SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, in SDL_RenderCopyF() argument
2957 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_RenderCopyF()
2959 if (renderer != texture->renderer) { in SDL_RenderCopyF()
2970 real_srcrect.w = texture->w; in SDL_RenderCopyF()
2971 real_srcrect.h = texture->h; in SDL_RenderCopyF()
2991 if (texture->native) { in SDL_RenderCopyF()
2992 texture = texture->native; in SDL_RenderCopyF()
3000 texture->last_command_generation = renderer->render_command_generation; in SDL_RenderCopyF()
3002 retval = QueueCmdCopy(renderer, texture, &real_srcrect, &real_dstrect); in SDL_RenderCopyF()
3007 SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, in SDL_RenderCopyEx() argument
3030 return SDL_RenderCopyExF(renderer, texture, srcrect, pdstfrect, angle, pfcenter, flip); in SDL_RenderCopyEx()
3034 SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, in SDL_RenderCopyExF() argument
3044 return SDL_RenderCopyF(renderer, texture, srcrect, dstrect); in SDL_RenderCopyExF()
3048 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_RenderCopyExF()
3050 if (renderer != texture->renderer) { in SDL_RenderCopyExF()
3064 real_srcrect.w = texture->w; in SDL_RenderCopyExF()
3065 real_srcrect.h = texture->h; in SDL_RenderCopyExF()
3085 if (texture->native) { in SDL_RenderCopyExF()
3086 texture = texture->native; in SDL_RenderCopyExF()
3104 texture->last_command_generation = renderer->render_command_generation; in SDL_RenderCopyExF()
3106 …retval = QueueCmdCopyEx(renderer, texture, &real_srcrect, &real_dstrect, angle, &real_center, flip… in SDL_RenderCopyExF()
3164 SDL_DestroyTexture(SDL_Texture * texture) in SDL_DestroyTexture() argument
3168 CHECK_TEXTURE_MAGIC(texture, ); in SDL_DestroyTexture()
3170 renderer = texture->renderer; in SDL_DestroyTexture()
3171 if (texture == renderer->target) { in SDL_DestroyTexture()
3174 FlushRenderCommandsIfTextureNeeded(texture); in SDL_DestroyTexture()
3177 texture->magic = NULL; in SDL_DestroyTexture()
3179 if (texture->next) { in SDL_DestroyTexture()
3180 texture->next->prev = texture->prev; in SDL_DestroyTexture()
3182 if (texture->prev) { in SDL_DestroyTexture()
3183 texture->prev->next = texture->next; in SDL_DestroyTexture()
3185 renderer->textures = texture->next; in SDL_DestroyTexture()
3188 if (texture->native) { in SDL_DestroyTexture()
3189 SDL_DestroyTexture(texture->native); in SDL_DestroyTexture()
3192 if (texture->yuv) { in SDL_DestroyTexture()
3193 SDL_SW_DestroyYUVTexture(texture->yuv); in SDL_DestroyTexture()
3196 SDL_free(texture->pixels); in SDL_DestroyTexture()
3198 renderer->DestroyTexture(renderer, texture); in SDL_DestroyTexture()
3200 SDL_FreeSurface(texture->locked_surface); in SDL_DestroyTexture()
3201 texture->locked_surface = NULL; in SDL_DestroyTexture()
3203 SDL_free(texture); in SDL_DestroyTexture()
3256 int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh) in SDL_GL_BindTexture() argument
3260 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_GL_BindTexture()
3261 renderer = texture->renderer; in SDL_GL_BindTexture()
3262 if (texture->native) { in SDL_GL_BindTexture()
3263 return SDL_GL_BindTexture(texture->native, texw, texh); in SDL_GL_BindTexture()
3265 … FlushRenderCommandsIfTextureNeeded(texture); /* in case the app is going to mess with it. */ in SDL_GL_BindTexture()
3266 return renderer->GL_BindTexture(renderer, texture, texw, texh); in SDL_GL_BindTexture()
3272 int SDL_GL_UnbindTexture(SDL_Texture *texture) in SDL_GL_UnbindTexture() argument
3276 CHECK_TEXTURE_MAGIC(texture, -1); in SDL_GL_UnbindTexture()
3277 renderer = texture->renderer; in SDL_GL_UnbindTexture()
3278 if (texture->native) { in SDL_GL_UnbindTexture()
3279 return SDL_GL_UnbindTexture(texture->native); in SDL_GL_UnbindTexture()
3281 FlushRenderCommandsIfTextureNeeded(texture); /* in case the app messed with it. */ in SDL_GL_UnbindTexture()
3282 return renderer->GL_UnbindTexture(renderer, texture); in SDL_GL_UnbindTexture()