Mercurial > sdl-ios-xcode
comparison src/video/SDL_video.c @ 3053:aa34d1180d30
When creating a software texture, synchronize the surface with the texture.
When creating a texture from a surface, synchronize the texture with the surface.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 30 Jan 2009 06:40:16 +0000 |
parents | 89f8a72e1ee9 |
children | 089a77aebb7d |
comparison
equal
deleted
inserted
replaced
3052:b7197d7e8566 | 3053:aa34d1180d30 |
---|---|
1633 SDL_DestroyTexture(textureID); | 1633 SDL_DestroyTexture(textureID); |
1634 return 0; | 1634 return 0; |
1635 } | 1635 } |
1636 } | 1636 } |
1637 | 1637 |
1638 { | |
1639 Uint8 r, g, b, a; | |
1640 int blendMode; | |
1641 int scaleMode; | |
1642 | |
1643 SDL_GetSurfaceColorMod(surface, &r, &g, &b); | |
1644 SDL_SetTextureColorMod(textureID, r, g, b); | |
1645 | |
1646 SDL_GetSurfaceAlphaMod(surface, &a); | |
1647 SDL_SetTextureAlphaMod(textureID, a); | |
1648 | |
1649 SDL_GetSurfaceBlendMode(surface, &blendMode); | |
1650 SDL_SetTextureBlendMode(textureID, blendMode); | |
1651 | |
1652 SDL_GetSurfaceScaleMode(surface, &scaleMode); | |
1653 SDL_SetTextureScaleMode(textureID, scaleMode); | |
1654 } | |
1655 | |
1638 if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) { | 1656 if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) { |
1639 SDL_SetTexturePalette(textureID, fmt->palette->colors, 0, | 1657 SDL_SetTexturePalette(textureID, fmt->palette->colors, 0, |
1640 fmt->palette->ncolors); | 1658 fmt->palette->ncolors); |
1641 } | 1659 } |
1642 return textureID; | 1660 return textureID; |