high,
ive recently started using OpenGL w/ SDL and am having some problems. how
would i go about making sure a surface is in the right (ie same) format
everytime no matter what? so far, this is what i do:
load in the image into a surface. now make another surface, which is
SDL_DisplayFormat(original_surface);
ok, now i have a surface which has the same pixel depth, etc of my screen.
now i just need to make it in RGB format. so i make another surface via
SDL_CreateRGBSurface(), and then i blit my DisplayFormat’d surface onto
this newly created surface. ok, great, now it has the same everything. i
just make the texture with GL_RGBA as the flags…
this works!! all my images are loading in properly, no matter what. only
heres the problem : i lose my alpha channel!!! why oh why am i losing my
alpha channel? i like it =)… anyway, how would i go about doing this so i
keep my alpha channel? i want a way that works no matter what image (if i
skip the second part of my method, IE i dont blt the surface onto an RGB
surface, only half my textures load in properly, but the ones that do keep
their alpha channel. so im assuming blitting my surface onto the RGB surface
makes me lose the alpha channel, and YES i send it
SDL_SRCALPHA|SDL_HWSURFACE… i read on a site im supsoed to use
PutPixel/GetPixel to do this, but im not sure how it works… can anyone
explain or suggest a differnt method?
thanks a lot for any help!!!_________________________________________________________________
Best Restaurant Giveaway Ever! Vote for your favorites for a chance to win
$1 million! http://local.msn.com/special/giveaway.asp