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

Author Topic: Building SFML for iOS and creating an iOS app  (Read 6375 times)

0 Members and 1 Guest are viewing this topic.

Morozov_5f

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Building SFML for iOS and creating an iOS app
« on: January 28, 2015, 10:50:43 pm »
Hi everyone! I know about this topic, but after reading it I still got some questions:
1. I don't quite get how to make an iOS project with SFML. I mean, I've added include path, drag'n'dropped all the stuff i build before and what next? I mean, how can I add an entry point for my app? Could someone give a small example, please or just explain for dummies like me? :)
2. Do I have to write code in Objective-C or C++ in iOS SFML?

Thank you :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Building SFML for iOS and creating an iOS app
« Reply #1 on: January 28, 2015, 10:55:53 pm »
You write code in C++ like before, SFML handles the Obj-C stuff and main loop for you. The only additional thing to do is to include <SFML/Main.hpp> in the file where your main() function is.
Laurent Gomila - SFML developer

Morozov_5f

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Building SFML for iOS and creating an iOS app
« Reply #2 on: January 28, 2015, 11:13:53 pm »
You write code in C++ like before, SFML handles the Obj-C stuff and main loop for you. The only additional thing to do is to include <SFML/Main.hpp> in the file where your main() function is.
I still don't quite get. Xcode default iOS project contains main.m, which already contains main(). Do I have to include <SFML/Main.hpp> right there? That's doubtfully. Or I need to create a *.cpp file with new entry point and include Main.hpp? Could you explain please? Sorry for bothering.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Building SFML for iOS and creating an iOS app
« Reply #3 on: January 29, 2015, 08:08:53 am »
Of course XCode creates a main.m file with a main() and a main loop. This is how everybody does when writing a native iOS app in Objective-C. But this is not what you do, you're writing a regular SFML app in C++, so you mustn't base it on the XCode iOS template (except for some project settings I guess). Just start with an empty project and add your own main.cpp and your own main function, which looks like the one you're used to write in C++. Don't overthink it, just do it like you did for non-iOS platforms ;)
Laurent Gomila - SFML developer

Morozov_5f

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Building SFML for iOS and creating an iOS app
« Reply #4 on: January 29, 2015, 08:15:38 am »
Oh, that simpe? Thanks a lot! I've been looking forward for iOS version of SFML, and now I can try it. Thank you again, SFML is the best. :)