Skip to content

Instantly share code, notes, and snippets.

@Twinklebear
Created July 19, 2012 00:01
Show Gist options
  • Save Twinklebear/3139827 to your computer and use it in GitHub Desktop.
Save Twinklebear/3139827 to your computer and use it in GitHub Desktop.
SDL_Texture* LoadImage(std::string file){
SDL_Texture* tex = nullptr;
tex = IMG_LoadTexture(renderer, file.c_str());
if (tex == nullptr)
throw std::runtime_error("Failed to load image: " + file);
return tex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment