title: sdl_loadbmp from file without using entire file path
body: <p>I'm trying to load an image from file without using the entire file path. Like in C#, However everything I try just throws my sdl error in the console when it gets to loading the image.</p>
  
  <pre><code>bool loadMedia()
       {
       //Loading success flag
       bool success = true;
  
       //Load splash image
       gHelloWorld = SDL_LoadBMP( "SDL2_tutorials02/hello_world.bmp" );
       if( gHelloWorld == NULL )
       {
           printf( "Unable to load image %s! SDL Error: %s\n", "SDL2_tutorials02/hello_world.bmp", SDL_GetError() );
           success = false;
       }
  
        return success;
     }
  </code></pre>
  
  <p>This is part of my original code that I learned from an online tutorial, trying to teach myself SDL and more about c++ </p>
  
  <p>edit for  InternetAussie, this is my entire source code from what I think I have learned from the tutorial is below:</p>
  
  <pre><code>//Using SDL and standard IO
  #include &lt;SDL.h&gt;
  #include &lt;stdio.h&gt;
  
  //Screen dimension constants
  const int SCREEN_WIDTH = 640;
  const int SCREEN_HEIGHT = 480;
  
  //Starts up SDL and creates window
  bool init();
  
  //Loads media
  bool loadMedia();
  
  //Frees media and shuts down SDL
  void close();
  
  //The window we'll be rendering to
  SDL_Window* gWindow = NULL;
  
  //The surface contained by the window
  SDL_Surface* gScreenSurface = NULL;
  
  //The image we will load and show on the screen
  SDL_Surface* gHelloWorld = NULL;
  
  bool init()
  {
  //Initialization flag
  bool success = true;
  
  //Initialize SDL
  if( SDL_Init( SDL_INIT_VIDEO ) &lt; 0 )
  {
      printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
      success = false;
  }
  else
  {
      //Create window
      gWindow = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
      if( gWindow == NULL )
      {
          printf( "Window could not be created! SDL_Error: %s\n", SDL_GetError() );
          success = false;
      }
      else
      {
          //Get window surface
          gScreenSurface = SDL_GetWindowSurface( gWindow );
      }
  }
  
  return success;
  }
  
  bool loadMedia()
  {
  //Loading success flag
  bool success = true;
  
  //Load splash image
  gHelloWorld = SDL_LoadBMP( "SDL2_tutorials02/hello_world.bmp" );
  if( gHelloWorld == NULL )
  {
      printf( "Unable to load image %s! SDL Error: %s\n", "SDL2_tutorials02/hello_world.bmp", SDL_GetError() );
      success = false;
  }
  
  return success;
  }
  
  void close()
  {
  //Deallocate surface
  SDL_FreeSurface( gHelloWorld );
  gHelloWorld = NULL;
  
  //Destroy window
  SDL_DestroyWindow( gWindow );
  gWindow = NULL;
  
  //Quit SDL subsystems
  SDL_Quit();
  }
  
  int main( int argc, char* args[] )
  {
  //Start up SDL and create window
  if( !init() )
  {
      printf( "Failed to initialize!\n" );
  }
  else
  {
      //Load media
      if( !loadMedia() )
      {
          printf( "Failed to load media!\n" );
      }
      else
      {
          //Apply the image
          SDL_BlitSurface( gHelloWorld, NULL, gScreenSurface, NULL );
  
          //Update the surface
          SDL_UpdateWindowSurface( gWindow );
  
          //Wait two seconds
          SDL_Delay( 2000 );
      }
  }
      //system halt for testing
  system("pause");
  
  //Free resources and close SDL
  close();
  
  return 0;
  }
  </code></pre>
  
  <p>and if it helps I followed the instructions in tutorial 1 at Lazy Foo' Productions. The hyperlink that I hope I have appropriately added is just the setup part after clicking through the steps on how to setup sdl on a windows machine using visual studios 2010 ultimate. I went with the system 32 setup using the console as my output source for errors.</p>