Load image to HWSURFACE

What’s the fastest way to load an image directly to an hardware surface? Is it

SDL_Surface * swImg, * hwImg;
swImg = SDL_LoadImage (FILENAME);
hwImg = SDL_CreateRGBSurface (SDL_HWSURFACE, swImg->w, swImg->h, swImg->format->BitsPerPixel, 0,0,0,0);
SDL_BlitSurface (swImg,NULL,hwImg,NULL);

or there is something faster?
Also, what’s the fastest way to load a surface from disk directly to screen?

CRV?ADER/KY

What’s the fastest way to load an image directly to an hardware surface? Is
it

SDL_Surface * swImg, * hwImg;
swImg = SDL_LoadImage (FILENAME);
hwImg = SDL_CreateRGBSurface (SDL_HWSURFACE, swImg->w, swImg->h,
swImg->format->BitsPerPixel, 0,0,0,0);
SDL_BlitSurface (swImg,NULL,hwImg,NULL);

or there is something faster?

I don’t know if it is faster, or if it works, but try creating the hwImg
surface, then load the image onto hwImg instead of swImg. Then, no blitting
is needed. As I said, don’t know if it works. The best way to test it would
be to check if the SDL_HWSURFACE flag is still set on hwImg->flags

Mike S._________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

What’s the fastest way to load an image directly to an hardware surface? Is
it

SDL_Surface * swImg, * hwImg;
swImg = SDL_LoadImage (FILENAME);
hwImg = SDL_CreateRGBSurface (SDL_HWSURFACE, swImg->w, swImg->h,
swImg->format->BitsPerPixel, 0,0,0,0);
SDL_BlitSurface (swImg,NULL,hwImg,NULL);

or there is something faster?

I don’t know if it is faster, or if it works, but try creating the hwImg
surface,

then load the image onto hwImg instead of swImg.

How? there is no function for that… should I write it manually?> Then, no blitting is needed. As I said, don’t know if it works. The best way to test it would

be to check if the SDL_HWSURFACE flag is still set on hwImg->flags