Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


SDL/OpenGL Blending


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 MaxFire   Members   -  Reputation: 187

Like
0Likes
Like

Posted 31 January 2012 - 04:24 PM

Hi guys edited this post due to location my problem (my original post was way off the mark), basically when I load an image using IMg_Load libery I then have to convert this image to 2^n dimensions for OpenGL blending. The way I go about this is to create a new surface with the same color format as the original one then simply blit the old onto the new. This causes a side effect, for some reason alpha is spread across the whole of the image making the background image show through. Any Ideas on how to prevent this, I have tried calling SDL_SetAlpha but nothing changed.

Here's my surface code

surface = SDL_CreateRGBSurface( SDL_SWSURFACE, Get2nNumber( origionalSurface->w ) , Get2nNumber( origionalSurface->h ), origionalSurface->format->BitsPerPixel, origionalSurface->format->Rmask, origionalSurface->format->Gmask, origionalSurface->format->Bmask, origionalSurface->format->Amask );
  SDL_Rect corner;
  corner.x = 0;
  corner.y = 0;

  SDL_BlitSurface( origionalSurface, NULL, surface, &corner );


Sponsor:

#2 MaxFire   Members   -  Reputation: 187

Like
0Likes
Like

Posted 01 February 2012 - 07:24 AM

updated




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS