Skip to content

Instantly share code, notes, and snippets.

@david-batranu
Created April 7, 2010 21:16
Show Gist options
  • Save david-batranu/359473 to your computer and use it in GitHub Desktop.
Save david-batranu/359473 to your computer and use it in GitHub Desktop.
SDL_Surface *load_image(std::string filename) {
SDL_Surface* loadedImage = NULL;
SDL_Surface* optimizedImage = NULL;
loadedImage = IMG_Load(filename.c_str());
if (loadedImage != NULL) {
optimizedImage = SDL_DisplayFormat(loadedImage);
SDL_FreeSurface(loadedImage);
}
return optimizedImage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment