Playing with it some more, hopefully with less silly mistakes. It seems there might be an issue with sf::Event::LostFocus on iOS. Using this:
#include <iostream>
#include <SFML/Main.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
int main( int argc, char* argv[] )
{
sf::RenderWindow window( sf::VideoMode( 1, 1 ), "Testing SFML" );
window.setFramerateLimit( 50 );
sf::RectangleShape shape;
shape.setSize( sf::Vector2f( 100, 100 ) );
shape.setPosition( 50, 50 );
shape.setFillColor( sf::Color::Blue );
std::cout << "start" << std::endl;
bool isRunning = true;
while ( isRunning )
{
sf::Event event;
while ( window.pollEvent( event ) )
{
if ( event.type == sf::Event::LostFocus )
{
isRunning = false;
}
}
shape.move( 0, 2 );
std::cout << "loop " << shape.getPosition().y << std::endl;
window.clear( sf::Color::White );
window.draw( shape );
window.display();
}
std::cout << "term" << std::endl;
return 0;
}
The program runs fine. When leaving the app, "loop <...>" stops appearing, but "term" does not appear. When reopening it, "term" appears and the screen stays black.
If I leave and reopen again, instead of rerunning the app, it crashes with EXC_BAD_ACCESS
here.
Also, it when loading a font I get 'Failed to load font "Arial.ttf" (failed to create the font face)'. I'm not sure if I put it on the wrong place though, I'll have to look more into it later.
Sprites/textures and touch events worked very well though.
My testing has been pretty simple so far.