hi,
first, id like to get the simple thing out of the way. when i was using SDL for
drawing, i would convert the surface to the pixel format of the screen right
away, so SDL wouldnt do it for me on the fly… now that im using OpenGL, do i
have to convert my images to the screen surface, before loading it into an
OpenGL texture? or does it not matter at this point?
second, ive recently had a problem with SDL and OpenGL. first, its a real PITA
to make sure each SDL_Surface is in the proper format before loading it in as a
texture for OpenGL. i finnally found a good system, which works on any image,
but theres on thing thats bothering me. this is my routine for loading in an
image to be turned into a texture:
load in the image via IMG_Load()
convert this surface to another via SDL_DisplayFormatAlpha()
call SDL_SetAlpha(img,0,0), where img was the surface i have so far
create ANOTHER surface, via SDL_CreateRGBSurface().
blit the image i loaded onto this newly created surface.
now the my surface is in RGB order, and still has the alpha channel!! awesome!
(it took me a long time to figure this all out =))
this works great! there is just one problem - the call to SDL_CreateRGBSurface()
for the bpp parameter, i MUST specify 32, or else it crashes!!! if i try putting
16 as the parameter, it will crash! does anyone know why? thanks for any help!!!
SDL_Create