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

Author Topic: Android and iOS ports available for testing  (Read 338679 times)

0 Members and 3 Guests are viewing this topic.

spacechase0

  • Newbie
  • *
  • Posts: 39
    • AOL Instant Messenger - thespacechase0
    • View Profile
    • http://spacechase0.com/
Re: Android and iOS ports available for testing
« Reply #30 on: December 02, 2013, 11:10:44 pm »
Quote
I think it has something to do with XCode coming through the app store now
Hmm I've never had problems with that. My Xcode was installed with the app store too, and as far as I remember the SDK was found at the same location -- automatically of course.
However I'm not up-to-date: Xcode 4.6 (I think ;D) and OS X 10.7.
I'm using Xcode 5.0.1 and OS X 10.9. I really have no clue what it is then. I don't have much experience with anything beyond a couple of experiments here and there.

So I tried a simple test app, and when it linked it gave some errors until I added the non-default libraries from here. It took me a while to figure that out and how to do it (properly), but I suppose it doesn't help that I haven't used XCode much since sometime in OS X 10.5/6.

Now that it is running all I get is a black screen for this:
Code: [Select]
#include <SFML/Main.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main( int argc, const char* argv[] )
{
sf::RenderWindow window( sf::VideoMode( 0, 0 ), "Testing SFML" );
//window.setFramerateLimit( 50 );

sf::RectangleShape shape;
shape.setSize( sf::Vector2f( 100, 100 ) );
shape.setPosition( 50, 50 );
shape.setFillColor( sf::Color::Blue );

bool isRunning = true;
while ( isRunning )
{
sf::Event event;
while ( window.pollEvent( event ) )
{
//
}

window.clear( sf::Color::White );
window.draw( shape );
window.display();
}

return 0;
}
The only iOS SDK I have available is 7.0 (simulator 7.0.3), so I wasn't able to test on anything else.


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Android and iOS ports available for testing
« Reply #31 on: December 03, 2013, 07:28:53 am »
Quote
So I tried a simple test app, and when it linked it gave some errors until I added the non-default libraries from here.
Oops, this is an important thing that I forgot to explain ;D Since SFML is linked statically, you have to link its dependencies yourself in your application.

Quote
Now that it is running all I get is a black screen for this
What if you use a valid size for the window? It is ignored by the window, but I think the default view still uses it.
Laurent Gomila - SFML developer

spacechase0

  • Newbie
  • *
  • Posts: 39
    • AOL Instant Messenger - thespacechase0
    • View Profile
    • http://spacechase0.com/
Re: Android and iOS ports available for testing
« Reply #32 on: December 03, 2013, 03:16:22 pm »
Oops, this is an important thing that I forgot to explain ;D Since SFML is linked statically, you have to link its dependencies yourself in your application.
Oh, that makes since. I don't link statically very often, and when I have I did it before that was needed on Windows. :P

What if you use a valid size for the window? It is ignored by the window, but I think the default view still uses it.
I was originally using (640, 480), but was trying to change it to see if something different would happen.

Shouldn't the screen at least be white though, since I'm clearing with sf::Color::White? I can't remember if that works with OpenGL ES, it has been a while since my attempt at it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Android and iOS ports available for testing
« Reply #33 on: December 03, 2013, 06:25:59 pm »
Quote
Shouldn't the screen at least be white though, since I'm clearing with sf::Color::White?
This may be the splash screen that automatically appears until the app is ready to run. Try to provide a custom one.
Laurent Gomila - SFML developer

spacechase0

  • Newbie
  • *
  • Posts: 39
    • AOL Instant Messenger - thespacechase0
    • View Profile
    • http://spacechase0.com/
Re: Android and iOS ports available for testing
« Reply #34 on: December 04, 2013, 05:51:09 pm »
This may be the splash screen that automatically appears until the app is ready to run. Try to provide a custom one.
It shows up for a second and fades then fades to black.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Android and iOS ports available for testing
« Reply #35 on: December 04, 2013, 06:02:00 pm »
You can also try iOS 6 instead of 7: in your project properties, select iOS 6 for "deployment target", and in the simulator, select iOS 6 too.
Laurent Gomila - SFML developer

spacechase0

  • Newbie
  • *
  • Posts: 39
    • AOL Instant Messenger - thespacechase0
    • View Profile
    • http://spacechase0.com/
Re: Android and iOS ports available for testing
« Reply #36 on: December 04, 2013, 07:59:24 pm »
That was obnoxious.

Anyways, Starbound is out. I'm going to be fairly distracted now. :P

(EDIT: I guess I should make it a little bit more clear, it does work now.)
« Last Edit: December 04, 2013, 08:04:25 pm by spacechase0 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Android and iOS ports available for testing
« Reply #37 on: December 04, 2013, 09:11:53 pm »
Great! :D
Laurent Gomila - SFML developer

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #38 on: December 05, 2013, 02:15:07 am »
Example app is crashing (SIGSEGV) for me using SDK 17 and 19 with NDK r9 (Asus Transformer Prime, Android 4.1.1):
Code: [Select]
I/DEBUG   (27754): backtrace:
I/DEBUG   (27754):     #00  pc 0000fc2a  /system/lib/libutils.so (android::String8::appendPath(char const*)+5)
I/DEBUG   (27754):     #01  pc 00018c6d  /system/lib/libandroidfw.so (android::AssetManager::open(char const*, android::Asset::AccessMode)+52)
I/DEBUG   (27754):     #02  pc 000089f9  /system/lib/libandroid.so (AAssetManager_open+28)
I/DEBUG   (27754):     #03  pc 0000a983  /data/data/com.example.sfml/lib/libsfml-system.so (sf::priv::ResourceStream::ResourceStream(std::string const&)+58)

The previous ESFML build worked without problems. The crash happens for both resources, the image as well as the audio file.

Edit:
My bad, obviously forgot to set ANDROID_USESTLPORT and it's working now. :)
« Last Edit: December 05, 2013, 06:24:16 pm by Mario »

CptZouglou

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Android and iOS ports available for testing
« Reply #39 on: December 06, 2013, 11:21:10 pm »
Hi there,

Thanks for the port ! I will try both android and iOS very soon (or when I have time...) . Simulator, iPhone and iPad :)

Good luck with that.

aratnon

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Android and iOS ports available for testing
« Reply #40 on: December 07, 2013, 03:33:49 am »
Is the stable version available soon? I would like to use SFML for my Android game project.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Android and iOS ports available for testing
« Reply #41 on: December 07, 2013, 10:10:11 am »
Is the stable version available soon? I would like to use SFML for my Android game project.
The more you help us stabilize it, the sooner it will be ready. ;)
Soon Jonathan will have time to go over the reports and we'll see where we can go from there.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

spacechase0

  • Newbie
  • *
  • Posts: 39
    • AOL Instant Messenger - thespacechase0
    • View Profile
    • http://spacechase0.com/
Re: Android and iOS ports available for testing
« Reply #42 on: December 08, 2013, 10:35:31 pm »
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.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #43 on: December 08, 2013, 10:43:08 pm »
Font loading is broken at the moment, same happens for Android.

Sonkun

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Re: Android and iOS ports available for testing
« Reply #44 on: December 09, 2013, 06:34:58 am »
Thanks for waiting! I'm now available to dig into these issues :D

So, what do we have here:

1) Crash when orientation changes (unless you set android:screenOrientation at landscape)
2) Alpha color issue
3) Figure out why some audio format cannot be played.
4) Drop stlport in favor of gnustl since it has poor C++11 support
5) sf::Text displays white rectangles
6) Add support for NDKr9b

Bug number 2 and 5 are fixed but I haven't pushed anything yet because I need confirmation from the iOS port.

Quote
I'm trying to build the android port but it is not working. Cmake says that the CMAKE_TOOLCHAIN_FILE  isn't being used by the project
This message shows up when I rerun CMake so don't worry, it's being used by the project.

Quote
Font loading is broken at the moment, same happens for Android.
What happens exactly? Does it fail to load any font file ? Or is it the same as bug number 5 ?

Quote
Is the stable version available soon? I would like to use SFML for my Android game project.
I just finished porting my game so I guess it's stable enough to start developing a game :D
 
Thanks everyone for your feedbacks and reports! :)
Interested in using SFML with Python ? Try out its Python binding!