Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Paths and OS X  (Read 2100 times)

0 Members and 1 Guest are viewing this topic.

lzr

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • http://lzr.cc
Paths and OS X
« on: January 10, 2009, 05:11:06 am »
I'm still fairly new to Mac programming, and I can't seem to figure this one out. When I load an image in a local directory, using something like Image.LoadFromFile("image.png"), the program can load the image when I run it from within Xcode, but when I try running the program outside of Xcode, it no longer finds the local files.

Also, is there some way to find the directory of the Bundle Resources folder in the code? If I hard code it in, than that means if the user changes the program name, the program will no longer work.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Paths and OS X
« Reply #1 on: January 10, 2009, 02:11:55 pm »
It's being discussed there : http://www.sfml-dev.org/forum/viewtopic.php?p=5727#5727

This is a working directory issue. When you launch your app from Xcode, the working directory is set to the folder containing you app, but when launching from the Finder, no working directory is set, and the default one is the root : /.
Want to play movies in your SFML application? Check out sfeMovie!

 

anything