1
General discussions / Re: Android and iOS ports available for testing
« on: July 21, 2017, 07:44:17 am »Hi
The iOS/Android ports are finally ready for beta-testing. This happens one month after the expected date, sorry for the delay (everyone is very busy -- more than usual). Until Jonathan pushes the code to the public repository, here is what you need to know if you want to play with them.
Where?
The ports will be available in the ios_and_android branch of the repository. This way it won't bother people who are not interested, and the amount of testers (and reports) is kept under control.
How to compile the iOS port?
To compile the iOS port, you must use the Xcode generator of CMake, and define the "IOS" boolean variable (set to TRUE) before configuring for the first time. The generated projects can then be compiled for x86 (simulator) or armv6/v7 (device) by selecting the target in Xcode; no need to generate multiple builds for that. SFML is built as static libraries on iOS (this is the only option for this OS).
To use SFML in your iOS app project, do as usual: add the include path to your project settings, and drag'n'drop the libraries into your project. Since SFML is linked statically, you'll have to link all its non-default dependencies as well (extlibs/libs-ios).
Note that you'll need a registered Apple developer account in order to copy and run your app on a device; otherwise the simulator will be your only choice.
How to compile the Android port?
How to compile the OpenGL ES port for Linux?
Things to know for Android
Jonathan will explain that as soon as he is available
New API
Only a few things have been added to the public API:
- The sf::Keyboard::setVirtualKeyboardVisible function
- The Touch API:
- A sf::Touch class (similar to sf::Mouse)
- sf::TouchBegan / sf::TouchMoved / sf::TouchEnded events (similar to mouse events)
General things to know
The sensors (accelerometer, gyroscope, compass, ...) are currently using the Joystick API (see the sources for more detail about the mapping). We'll soon add a sf::Sensor API that better matches the requirements.
The foreground / background events are mapped to the GainedFocus and LostFocus events.
Orientation changes are mapped to the Resize event.
sf::Shader is not available, because the implementation is based on OpenGL ES 1. Shaders are only available in OpenGL ES 2, which would require a major rewriting of the graphics part. So that won't be done in a near future.
Things to know for iOS
On iOS, the working directory is automatically set to the resources directory.
There's no audio module on iOS, I'm still waiting for libsndfile to add a license exception for iOS so that I can use it statically without breaking the terms of the license. The author said it was one of its priorities, but it was months ago and I've got no news...
The implementation should be compatible with iOS 4.0 and more.
The size of the window is ignored, the screen size is always used.
Examples are not available. It seems that CMake is not ready for that, it still requires too many hacks, and even with them, it was still pretty bad.
The ugly hack: you need to include <SFML/Main.hpp> in the file where your main function is defined. This is because SFML has to hijack it, and rename your own main to call it later.
There's no specific support for high-resolution (retina) screens, they currently produce the same output as low-res screens (this will be done later).
Important
Until everything is merged into master, please use the forum for your feedback. You can post here or open new threads. There are still many things to do, I don't want to pollute the task tracker
Thanks @Laurent