Jump to content
  • Advertisement
Sign in to follow this  
raptorstrike

loading bmp from seprate folder

This topic is 5049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
SDL_LoadBMP takes a filename, does it not? And this filename, it can be a fully specified or even relative path, can it not?

Share this post


Link to post
Share on other sites
SDL_LoadBMP("..//directory//file.bmp");
the '..' puts you back to the root directory, say if you game was in the /bin directory.
the '//' is the escape code for a forward slash. kinda like '/n'.

Share this post


Link to post
Share on other sites
Quote:
Original post by PnP Bios
the '..' puts you back to the root directory...
No. .. moves you up one directory. To jump to root, start the path with / or \\.

Quote:
the '//' is the escape code for a forward slash.
No. You don't need to escape forward slash, only backward slash, and only because the backslash character initiates an escape sequence.

For instance, that would be \n.

Share this post


Link to post
Share on other sites
I_Player[0][0] = SDL_LoadBMP("BMPs//Player//Player_UL.bmp");

so that SHOULD be a vaild path? (yes those folders and that file exists in the directory im using) thanks for the replys

Share this post


Link to post
Share on other sites
Quote:
Original post by raptorstrike
I_Player[0][0] = SDL_LoadBMP("BMPs//Player//Player_UL.bmp");

so that SHOULD be a vaild path? (yes those folders and that file exists in the directory im using) thanks for the replys


I_Player[0][0] = SDL_LoadBMP("BMPs/Player/Player_UL.bmp");
Works with me.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!