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

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

0 Members and 6 Guests are viewing this topic.

Sonkun

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Re: Android and iOS ports available for testing
« Reply #135 on: April 15, 2014, 04:18:10 pm »
I just rebased ios_and_android branch onto master thus to update your local branch git pull won't work, you'll need to recreate it.
Interested in using SFML with Python ? Try out its Python binding!

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #136 on: April 15, 2014, 04:52:32 pm »
Just pulled repo. Error in building armeabi-v7a.
/development/sfmles/src/SFML/Window/JoystickManager.cpp: In member function 'void sf::priv::JoystickManager::update()':
/development/sfmles/src/SFML/Window/JoystickManager.cpp:94:57: error: 'class sf::priv::JoystickImpl' has no member named 'getIdentification'
                     item.identification = item.joystick.getIdentification();
                                                         ^
make[2]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/JoystickManager.cpp.o] Error 1
 

But i don't understand this: Don't mix stl libs. =)
./../..//src/core/extendedwindow.cpp:101: error: undefined reference to 'sf::String::String(std::string const&, std::locale const&)'
./../..//src/core/log.cpp:212: error: undefined reference to 'sf::String::String(char const*, std::locale const&)'
/home/steelrat/development/android-ndk/sources/oolua/include/oolua/proxy_constructor.h:191: error: undefined reference to 'sf::String::String(std::string const&, std::locale const&)'
/home/steelrat/development/android-ndk/sources/oolua/include/oolua/proxy_caller.h:156: error: undefined reference to 'sf::String::toAnsiString(std::locale const&) const'
./../..//src/gfx/debuginfo.cpp:77: error: undefined reference to 'sf::String::String(char const*, std::locale const&)'
collect2: error: ld returned 1 exit status
 


It's alive:
04-16 10:51:46.153: I/Croger(15876): Using app data dir: /data/croger/
04-16 10:51:46.153: I/Croger(15876): Log file: /data/croger/croger.log
04-16 10:51:46.182: I/Croger(15876): LanguageManager: current locale is (null)
04-16 10:51:46.182: A/libc(15876): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 15902 (milyxoft.croger)
No questions to SFMLES now. =)

As i understand, there is no way to get locale from C. So i think, such method must be implemented in SFMLES. Or may be better is to create some sort of wrapper to allow programer fast bind to java... Well, it is just variant, i have not thought through this.
And AAssetManager must be available with SFML methods.
« Last Edit: April 16, 2014, 10:19:26 am by ChronicRat »

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #137 on: April 16, 2014, 01:13:04 pm »
Android example:
04-16 15:06:30.044: A/libc(25459): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 25564 (om.example.sfml)
 
Yes, i can turn off music in example, but i can't turn off music in my game. So this bug is critical, i will try to resolve it myself if Sonkun is busy. And another bug - program crashes or hang ups when rotating phone i.e. crash on screen rotation. Is it tries to recreate window?

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #138 on: April 16, 2014, 01:35:05 pm »
Of course that's no permanent solution, just a temporary workaround for testing.

Edit:
As for the build error, you can use this commit:
https://github.com/MarioLiebisch/SFML/commit/b8c2cdcfbc10d76db7cdb2a9f5fa0c544b497ad6

Edit 2:
Why no locale in C? Never tried using setlocale() on Android, but it should be available.
« Last Edit: April 16, 2014, 01:55:55 pm by Mario »

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #139 on: April 16, 2014, 03:39:03 pm »
Yes, Joystick i fixed already, but i did not declared class member, just return Joystick::Identification();
setlocale returns nullptr. Google said that there is no access to current locale from NDK.
And i built the most fresh OpenAL from repo - no crash on sound play now. I'm just replaced shared object (openal.so) in $(NDK)/sources/sfml/ext-libs and rebuilt Android example - sound works.

First run: broken graphics and no reaction on touch. i'm not implemented using of sf::Touch yet.
Log:
E/libEGL(27480): called unimplemented OpenGL ES API

« Last Edit: April 16, 2014, 04:28:10 pm by ChronicRat »

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #140 on: April 16, 2014, 04:15:14 pm »
Interesting. Which OpenAL repository?

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #141 on: April 16, 2014, 04:17:27 pm »
I thought there is only one. =) This one - http://kcat.strangesoft.net/openal.html
Here is Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := openal

FILE_LIST := $(wildcard $(LOCAL_PATH)/OpenAL32/*.c)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Alc/*.c)
#FILE_LIST += $(wildcard $(LOCAL_PATH)/Alc/backends/*.c)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Alc/effects/*.c)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Alc/midi/*.c)

exclude := %alsa.c %dsound.c %oss.c %portaudio.c %pulseaudio.c\
        %solaris.c %winmm.c %mixer_neon.c %mixer_sse.c %coreaudio.c\
        %mmdevapi.c %qsa.c %sndio.c %mixer_inc.c

FILE_LIST := $(filter-out $(exclude),$(FILE_LIST))

LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) Alc/backends/base.c\
        Alc/backends/opensl.c Alc/backends/loopback.c Alc/backends/null.c

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/OpenAL32/Include $(LOCAL_PATH)/Alc
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/AL
LOCAL_CFLAGS := -DAL_BUILD_LIBRARY -DAL_ALEXT_PROTOTYPES -DIN_IDE_PARSER -DNO_LOGGING -std=c99
LOCAL_LDLIBS := -lOpenSLES -llog -s
include $(BUILD_SHARED_LIBRARY)
 
About defines:
-std=c99 - solved the problem with multiple definitions.
IN_IDE_PARSER - fixes bug with restrict macro, which is defined only when defined IN_IDE_PARSER
NO_LOGGING - my own define to disable ERR, WARN etc macros. I changed alMain.h:870 a little:
(i'm not checked, may be with forced C99 there are no need to disable log macros)
#ifdef NO_LOGGING
#define TRACEREF(...)
#define TRACE(...)
#define WARN(...)
#define ERR(...)
#else
#define TRACEREF(...) do {                                                    \
    if(LogLevel >= LogRef)                                                    \
        AL_PRINT("(--)", __VA_ARGS__);                                        \
} while(0)


#define TRACE(...) do {                                                       \
    if(LogLevel >= LogTrace)                                                  \
        AL_PRINT("(II)", __VA_ARGS__);                                        \
} while(0)


#define WARN(...) do {                                                        \
    if(LogLevel >= LogWarning)                                                \
        AL_PRINT("(WW)", __VA_ARGS__);                                        \
} while(0)


#define ERR(...) do {                                                         \
    if(LogLevel >= LogError)                                                  \
        AL_PRINT("(EE)", __VA_ARGS__);                                        \
} while(0)

#end
#endif

And you'll need to create own config.h from config.h.in
« Last Edit: April 16, 2014, 08:40:44 pm by ChronicRat »

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #142 on: April 16, 2014, 08:22:11 pm »
What exactly this error does mean?
 E/libEGL(3472): called unimplemented OpenGL ES API
I don't use any direct OpenGL code, all operations via SFML.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #143 on: April 16, 2014, 09:35:54 pm »
I'd say you (or SFML :P) tried to use some OpenGL ES call that isn't implemented in your version of the NDK for whatever reason.

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #144 on: April 17, 2014, 08:05:43 am »
Latest NDK, APP_PLATFORM - 10. Test smartphone with Android 4.2.2. What SFMLES need as minimum platform?
And again, what do with shaders? Currently i'm not using shaders, but, in future, may be i can enable GLES2 myself and use own code? Or shaders soon will be in SFMLES?
« Last Edit: April 17, 2014, 08:26:05 am by ChronicRat »

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #145 on: April 17, 2014, 07:21:51 pm »
Never had OpenGL ES issues using APP_PLATFORM on 9. Weird. Would you mind sharing your config.h? Couldn't get it to compile so far.

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #146 on: April 17, 2014, 08:29:35 pm »
Openal-soft config.h
By the way, may be -DIN_IDE_PARSER in Android.mk is useless too after adding -std=c99
« Last Edit: April 17, 2014, 08:32:49 pm by ChronicRat »

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #147 on: April 18, 2014, 02:53:54 pm »
So, i have several thoughts what i need (and i think others too):
1) access to ANativeActivity to get app path, or asset manager, or make it possible via special Android-only interface.
2) callbacks to Android events (Pause, Start) or make them via SFML events system (for example GainedFocus and LostFocus)
3) bind AKEYCODE_BACK to Keyboard::Escape
4) emulate CTRL+ESC (or any other combination, may be dynamicly changable) for AKEYCODE_MENU

Sorry, if all of this is available now, and just i have to rtfm.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #148 on: April 18, 2014, 03:18:57 pm »
Got it working late last night. I've had to use the latest source from their repostirry (OpenAL) and make some minor modifications, but it's working and it's quite small as well. :)

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Android and iOS ports available for testing
« Reply #149 on: April 19, 2014, 07:05:29 pm »
Mario, is sf::VertexArray supported by SFMLES? In my game does not work VertexArrays, Fonts, RenderTextures and sprites has no transparence.  :o