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

Author Topic: How to create sf::Window to iOS app?  (Read 1780 times)

0 Members and 1 Guest are viewing this topic.

smartly

  • Newbie
  • *
  • Posts: 10
    • View Profile
How to create sf::Window to iOS app?
« on: October 23, 2014, 05:04:55 pm »
I compiled sfml-*.a :
Code: [Select]
cmake . -DSFML_BUILD_EXAMPLES=TRUE -DSFML_OS_IOS=TRUE
make

but, how to use it?

in my ViewController.m ?

thanks!!

smartly

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: How to create sf::Window to iOS app?
« Reply #1 on: October 23, 2014, 05:06:58 pm »
here into code ?

Code: [Select]
#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // here into code ?
}

...

smartly

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: How to create sf::Window to iOS app?
« Reply #2 on: October 23, 2014, 05:09:37 pm »
not found ios example in dir:
SFML/examples/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to create sf::Window to iOS app?
« Reply #3 on: October 23, 2014, 05:55:12 pm »
Please edit your initial post instead of creating 3 in 5 minutes.

The use of SFML on iOS is exactly the same as on any other platform. Note that when you build SFML for iOS you must set the IOS variable to TRUE, not SFML_OS_IOS. And there's no example because there was an issue with CMake, it is not able to handle the resources correctly.

Then all you have to do is to include <SFML/Main.hpp> in the file where you have your main(). SFML will run the internal event loop and all the Objective-C stuff for you, you can focus on writing your C++ app like on any other OS.
Laurent Gomila - SFML developer