SDL/OpenGL Blending

Started by
0 comments, last by maxfire 12 years, 2 months ago
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 );
Advertisement
updated

This topic is closed to new replies.

Advertisement