Forcing RGBA instead of RGB when loading images as SDL surfaces in OpenGL
Hi guys, I want to use GL_RGBA instead of GL_RGB for transparencies. How would I do that? I am currently using the blending method from Nehe's tutes but sometines the blending does not go well with the terrain.
Here's an example file with source:
Needs SDL.DLL
http://rel.betterwebber.com/junk.php?id=38
Controls are MOUSE, WASD and the mouse buttons.
Thanks in advance!!!
I have a function which calls SDL_CreateRGBSurface with the appropriate masks (1 byte for R,G,B, and A), then I use SDL_BlitSurface to copy from the RGB surface onto the RGBA one. That gives you a target for glTexImage2D, and then you can free both SDL_surfaces.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement