Public Group

# SDL/OpenGL Blending

This topic is 2508 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 );

updated

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633702
• Total Posts
3013450
×