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

Author Topic: Xcode 4 accessing resource path  (Read 2666 times)

0 Members and 1 Guest are viewing this topic.

sbroadfoot90

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Xcode 4 accessing resource path
« on: October 07, 2011, 01:28:15 pm »
Laurent, this is more a direct message to you, but also a pointer for anyone wondering.

I spent about 2 hours trying to work out an elegant way of accessing the Resources directory when building an app with Xcode 4, only to realise Laurent had already included this helper function in the Xcode 4 templates.

So anyone who comes across the same problem you just need to

Code: [Select]
#include "ResourcePath.hpp"

and then you can load images etc like so

Code: [Select]
Texture.LoadFromFile(ResourcePath() + "Background.png")

By the way Laurent, your helper function is much more elegant than Ogre3D's version of the same thing

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Xcode 4 accessing resource path
« Reply #1 on: October 07, 2011, 01:45:44 pm »
It's not me. Everything which is related to Mac OS X is done by Hiura ;)
Laurent Gomila - SFML developer

sbroadfoot90

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Xcode 4 accessing resource path
« Reply #2 on: October 07, 2011, 02:17:38 pm »
Well

Code: [Select]
sed -i 's/Laurent/Hiura/g' OP

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Xcode 4 accessing resource path
« Reply #3 on: October 07, 2011, 07:00:30 pm »
Yeah, I guess the tutorial dedicated to OS X will mention this function when 2.0 is released.


Quote from: "sbroadfoot90"
By the way Laurent, your helper function is much more elegant than Ogre3D's version of the same thing
Thanks!
SFML / OS X developer