SFML community forums

Help => General => Topic started by: smartly on October 23, 2014, 05:04:55 pm

Title: How to create sf::Window to iOS app?
Post by: smartly 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!!
Title: Re: How to create sf::Window to iOS app?
Post by: smartly 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 ?
}

...
Title: Re: How to create sf::Window to iOS app?
Post by: smartly on October 23, 2014, 05:09:37 pm
not found ios example in dir:
SFML/examples/
Title: Re: How to create sf::Window to iOS app?
Post by: Laurent 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.