A simple SDL script that creates a window
Is there possibly a way to take out the nested if statements without losing the error reports? 


Use RAII to encapsulate your resources into objects that enforce the create/destroy pairing. You can write your own RAII wrapper objects or (better) use a resource factory that creates std::unique_ptr/std::shared_ptr's. A concrete factory for arbitrary SDL resources:

namespace sdl2 {
template &lt;typename Creator, typename Destroyer, typename... Arguments&gt;
auto make_resource(Creator c, Destroyer d, Arguments &amp;&amp;... args) {
  auto r = c(std::forward&lt;Arguments&gt;(args)...);
  if (!r) {
    throw std::system_error(errno, std::generic_category(), SDL_GetError());
  }
  return std::unique_ptr&lt;std::decay_t&lt;decltype(*r)&gt;, decltype(d)&gt;(r, d);
}
} // namespace sdl2


This factory attempts to create the resource, checks to ensure it was created, and returns a unique_ptr that destroys the resource correctly when the pointer goes out of scope.  Specific helpers to provide higher levels of abstraction for resources like SDL_Window, SDL_Texture, SDL_Renderer, etc, can be created like so:

namespace sdl2 {
using WindowPtr = std::unique_ptr&lt;SDL_Window, decltype(&amp;SDL_DestroyWindow)&gt;;

WindowPtr make_window(const char *title, int x, int y, int w, int h,
                      std::uint32_t flags) {
  return make_resource(SDL_CreateWindow, SDL_DestroyWindow, title, x, y, w, h,
                       flags);
}
} // namespace sdl2


You can write your own abstractions over SDL's C API to utilize some of the modern C++ constructs and ideally end with something like this:

int main() try {
  auto window = sdl2::make_window("Slime Runner Prelim Tests", 
                                  SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 
                                  640, 480, 
                                  SDL_WINDOW_SHOWN);
  auto screen = sdl2::get_surface(window);
  auto image = sdl2::load_bitmap("Images/Background.tmp");
  sdl2::blit_surface(image, nullptr, screen, nullptr);
  sdl2::update_surface(window);
  sdl2::delay(4s);
} catch (...) {
  std::cout &lt;&lt; "Error: " &lt;&lt; error.what() &lt;&lt; '\n';
}


Note: You don't have to use exceptions, but RAII does provide you with the flexibility to choose whichever error handling system you want (exceptions, checked errors, etc) while simplifying the cleanup process.



int main(int argc, char *argv[])


If you are not using argc and argv, omit them.

int main()




std::endl


Be aware of what std::endl actually does.  If you simply want to print a newline character, prefer '\n' since it's both shorter and correct.



SDL_BlitSurface(imageSurface, NULL, windowSurface, NULL);


Use nullptr instead of NULL.