SDL_image, SDL_RWops


A few doubts:

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

  • 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?


all you need is this:

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