We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2113

Summary: SDL_RenderCopyEx is not working properly.
Product: SDL_image Reporter: Lísias de Castro <saisilcastro>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86_64   
OS: Windows 7   

Description Lísias de Castro 2013-09-25 12:14:40 UTC
I have downloaded the sdl2 and sdl2_image.
I intalled it sucessfully and putted it to run.
The problem is when I try to make my picture transparent.
When I use SDL_RenderCopy instead if SDL_RenderCopy the
transparency is applied normally. But when I change the
code to SDL_RenderCopyEx the picture only appears with
the alpha set like 255. when I try to use less than
this the image suddenly desapears. I can rotate the
image I can zoom it. But I can't make it transparent.
I've tried to change the pixel format, but it did not
work. When I try to use de accelerated mode it does not
appear even in 255 alpha.
Thanks for the attention!
Comment 1 Sam Lantinga 2013-09-28 06:10:06 UTC
Can you attach a simple test program and data files to show the problem?

Thanks!
Comment 2 Lísias de Castro 2013-09-29 03:43:00 UTC
<code>
// This is the function to initialize the allegro itself

STATUS RunMachine(PMACHINE MachineLeader,char * ClanMachine,char * ClanView,char * ID){
  LoadMachine(MachineLeader,ClanMachine,ClanView,ID);
  if(SDL_Init(SDL_INIT_EVERYTHING))Quit(2);
  MachineLeader->Camera.Frame = SDL_CreateWindow(MachineLeader->Camera.Title.Text,
                                                MachineLeader->Camera.X,
                                                MachineLeader->Camera.Y,
                                                MachineLeader->Camera.Width,MachineLeader->Camera.Height,
                                                MachineLeader->Camera.ViewType);
  if (!MachineLeader->Camera.Frame){Quit(2);}
  MachineLeader->Camera.Renderer = SDL_CreateRenderer(MachineLeader->Camera.Frame, -1,1);
  if (TTF_Init()==-1)Quit(2);
  SDL_StartTextInput();
  return On;
  }

// This is the code that I am using in order to draw the pic


void DrawLink(LINK ToDraw,PMACHINE Machine){
  SDL_Rect Glass;
  Glass.w = (ToDraw.Object.Width  * ToDraw.Object.WidthSize);
  Glass.h = (ToDraw.Object.Height * ToDraw.Object.HeightSize);
  Glass.x = (int)ToDraw.Object.XView+ToDraw.Object.XScroll;
  Glass.y = (int)ToDraw.Object.YView+ToDraw.Object.YScroll;
  SDL_Point point;
  point.x = 0;
  point.y = 0;
  SDL_SetTextureAlphaMod(ToDraw.Sprite,ToDraw.Object.Color.A);
  // When I use the function SDL_RenderCopyEx it only works in alpha 255
  SDL_RenderCopyEx(Machine->Camera.Renderer,ToDraw.Sprite,NULL,&Glass,ToDraw.Object.Angle,&point,SDL_FLIP_NONE);
  // When I use the function SDL_RenderCopy the transparency works. :/
  ///SDL_RenderCopy(Machine->Camera.Renderer,ToDraw.Sprite,NULL,&Glass);
  }

</code>
Comment 3 Lísias de Castro 2013-10-11 13:15:36 UTC
Hey guys. I would like you all to unconsider my bug relate. It is working just fine. The only reason it was not working properly was my video card driver. It was not updated, so I could not use the SDL_RenderCopyEx with alpha colors. For some reason the SDL_RenderCopy could work even with the old drivers. But now I can work. Thanks to you all. Very happy now. *------*