SDL_image, SDL_RWops

Hi,

A few doubts:

  • Where can I find more things about SDL_RWops, since I didn’t find at
    the docs on libsdl.org?

  • I want to load a .jpg file, what’s wrong in the next piece of code?

SDL_RWops *fundo;
SDL_Surface *cenario;

fundo = DL_RWFromFile(“imagens/K-Hero.jpg”, “r”);

cenario = IMG_LoadJPG_RW(fundo);

  • What are the functions to load image files? Is there anything like the
    SDL Guide on this subject to make my life easier?

Thiago

all you need is this:

SDL_Surface cenario;
cenario=IMG_Load(“imagens/K-Hero.jpg”);
if(!cenario) {
printf(“imagens/K-Hero.jpg: %s\n”,SDL_GetError());
/
you may want to exit(1); if cenario is NULL. */
}–
-==-
Jon Atkins
http://jonatkins.org/