SDL2 transparensy

Hi.
I do not sense the behavior SDL_SetTextureAlphaMod().
If I make:

Code:
SDL_Texture *img = IMG_LoadTexture(render, “image.png”);
SDL_SetTextureAlphaMod(img, 127);

the texture is thanslucent.
But I make:

Code:
*img = SDL_CreateTexture(render, SDL_PIXELFORMAT_RGBA8888, 0, 150, 50);
SDL_SetTextureAlphaMod(img, 127);

the texure not transparensy. I will yea make transparent image.png and load it [Shocked]
Any ideas?

You might want to try calling SDL_SetTextureBlendMode();

Sorry.
Now I understand yet less.
I fill texture blue color. If I use key SDL_BLENDMODE_BLEND the image is not visible, but I use SDL_BLENDMODE_NONE

Code:
SDL_Texture *backgr = IMG_LoadTexture(render, “image.png”);
SDL_Texture *img = SDL_Texture *img = SDL_CreateTexture(render, SDL_PIXELFORMAT_RGBA8888, 0, 150, 50);
SDL_SetTextureBlendMode(img, SDL_BLENDMODE_NONE);
SDL_SetTextureColorMod(img, 0, 0, 200);
SDL_SetTextureAlphaMod(img, 127);
SDL_Rect bk_pos;
bk_pos.x = 0;
bk_pos.y = 0;
bk_pos.w = 150;
bk_pos.h = 50;

while (true)
{
SDL_RenderClear(render);
SDL_RenderCopy(render, backgr, NULL, NULL);
SDL_RenderCopy(render, img, NULL, &bk_pos);
SDL_RenderPresent(ren);
}

in image not plain blue, but is blended the elements my desktop :o
[Image: http://s7.hostingkartinok.com/uploads/images/2014/06/f48fe7d0610640cac82d8bd9cc33162b.jpg ] (http://hostingkartinok.com/show-image.php?id=f48fe7d0610640cac82d8bd9cc33162b)

I jast do non understand, what is happened [Shocked]
I have run whitout flag SDL_INIT_AUDIO and all works good.

Can you report a bug to bugzilla.libsdl.org and include what operating
system you’re using, what renderer you’re using and attach a simple
example, with any data files it requires?

Thanks!On Fri, Jul 11, 2014 at 1:13 PM, Mantis wrote:

I jast do non understand, what is happened [image: Shocked]
I have run whitout flag SDL_INIT_AUDIO and all works good.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org