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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ast

Pages: [1] 2
1
General discussions / Re: SFML 3 - What is your vision?
« on: March 12, 2016, 10:03:04 pm »
In rhythm based games it would be important to know with reasonable accuracy what sample is playing right now. If I recall correctly there was some difficulties with that.

Otherwise, I would second what has proposed in a few other messages in this chain that it would be great if there would be more higher level stuff for typical game creating purposes. Not included directly in SFML but with additional libraries that would be shipped with SFML or recommended as to the default way of doing things. Thor would clearly be one of those. Actually this looks like a separate project that would build on SFML.

2
General / Re: Using external libraries like Thor in Android build
« on: March 12, 2016, 09:19:27 pm »
ast@superstar ~/src/sfml-tmxloader/build/armeabi-v7a $ make VERBOSE=1 pugi

...

Linking CXX shared library libpugi.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/pugi.dir/link.txt --verbose=1
/home/ast/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc  -fPIC -fexceptions -frtti -fpic -Wno-psabi --sysroot=/home/ast/Android/Sdk/ndk-bundle/platforms/android-8/arch-arm -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fdata-sections -ffunction-sections -Wa,--noexecstack  -std=c++11  -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-allow-shlib-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now  -shared -Wl,-soname,libpugi.so -o libpugi.so CMakeFiles/pugi.dir/src/pugixml/pugixml.cpp.o  -L/home/ast/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/user/libs/armeabi-v7a /home/ast/Android/Sdk/ndk-bundle/platforms/android-8/arch-arm/usr/lib/libm.so /home/ast/Android/Sdk/ndk-bundle/platforms/android-8/arch-arm/usr/lib/libz.so  "/home/ast/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a" "/home/ast/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libsupc++.a" -lm
CMakeFiles/pugi.dir/src/pugixml/pugixml.cpp.o:pugixml.cpp:function pugi::impl::(anonymous namespace)::is_nan(double): error: undefined reference to '__fpclassifyd'
CMakeFiles/pugi.dir/src/pugixml/pugixml.cpp.o:pugixml.cpp:function pugi::impl::(anonymous namespace)::convert_number_to_string_special(double): error: undefined reference to '__fpclassifyd'
collect2: error: ld returned 1 exit status
make[3]: *** [libpugi.so] Error 1
make[3]: Leaving directory `/home/ast/src/sfml-tmxloader/build/armeabi-v7a'
make[2]: *** [CMakeFiles/pugi.dir/all] Error 2
make[2]: Leaving directory `/home/ast/src/sfml-tmxloader/build/armeabi-v7a'
make[1]: *** [CMakeFiles/pugi.dir/rule] Error 2
make[1]: Leaving directory `/home/ast/src/sfml-tmxloader/build/armeabi-v7a'
make: *** [pugi] Error 2
ast@superstar ~/src/sfml-tmxloader/build/armeabi-v7a $
 

There was libm.so with full path, which I added by hand:

-L ... /home/ast/Android/Sdk/ndk-bundle/platforms/android-8/arch-arm/usr/lib/libm.so
 

But still it did not found the '__fpclassifyd'. There was also -lm in the end, which I think links the math library normally (works perfectly when building for Linux desktop).

If I check what libm's are present in the referenced directory I find couple.
ast@superstar ~/Android/Sdk/ndk-bundle/platforms/android-8/arch-arm/usr/lib $ ls -lh libm*
-rw-r--r-- 1 ast ast 973K maali 10 15:56 libm.a
-rw-r--r-- 1 ast ast 1,3M maali 10 15:55 libm_hard.a
-rwxr-xr-x 1 ast ast  13K maali 10 15:57 libm.so
ast@superstar ~/Android/Sdk/ndk-bundle/platforms/android-8/arch-arm/usr/lib $
 

Grepping the missing function finds it in static libraries. The shared library does not match but it is only 13K so I guess the actual binary code is somewhere else. (where?)
ast@superstar ~/Android/Sdk/ndk-bundle/platforms/android-8/arch-arm/usr/lib $ grep  __fpclassifyd *
Binary file libm.a matches
Binary file libm_hard.a matches
ast@superstar ~/Android/Sdk/ndk-bundle/platforms/android-8/arch-arm/usr/lib $
 

Any of the tons of sfml android developers there ever stumbled on similar problems? ;) It seems likely that all these cmake woes are caused by some false configuration. Would just like to know what.. 

3
General / Re: Export SFML project to Android
« on: March 12, 2016, 08:42:59 pm »
Small and medium-size dragons may lurk here and there when trying to build for android  ;)

4
General / Re: Using external libraries like Thor in Android build
« on: March 10, 2016, 10:40:11 pm »
I redid all of the above in native Linux machine. Previous was a virtual box Linux guest running on Windows host. The result was however exactly the same so it seems that virtual machine did not play any role here. I did not expected it to do so.

I am now trying to build sfml-tmxloader. FindSFML did not work but similar path forcing that in Thor case made it possible to generate make files. sfml-tmxloader has pugixml, which is compiled as a library.

ast@superstar ~/src/sfml-tmxloader/build/armeabi-v7a $ make
[  8%] Building CXX object CMakeFiles/pugi.dir/src/pugixml/pugixml.cpp.o
Linking CXX shared library libpugi.so
CMakeFiles/pugi.dir/src/pugixml/pugixml.cpp.o:pugixml.cpp:function pugi::impl::(anonymous namespace)::is_nan(double): error: undefined reference to '__fpclassifyd'
CMakeFiles/pugi.dir/src/pugixml/pugixml.cpp.o:pugixml.cpp:function pugi::impl::(anonymous namespace)::convert_number_to_string_special(double): error: undefined reference to '__fpclassifyd'
collect2: error: ld returned 1 exit status
make[2]: *** [libpugi.so] Error 1
make[1]: *** [CMakeFiles/pugi.dir/all] Error 2
make: *** [all] Error 2
ast@superstar ~/src/sfml-tmxloader/build/armeabi-v7a $
 

It seems that it does not know how to link against math library. What could be the reason that cmake things seems to be broken when cross compiling for android??

5
General / Re: Using external libraries like Thor in Android build
« on: March 07, 2016, 09:41:27 pm »
It seems that I more or less succeeded in build Thor for ARM:

ast@lumo /media/sf_C_DRIVE/Android/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/user/lib $ file libthor.so
libthor.so: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
 

make install put the resulting .so to rather peculiar place -- hope its ok..

I needed to force SFML_INCLUDE_DIR in FindSFML.cmake

set(SFML_INCLUDE_DIR /media/sf_C_DRIVE/Android/ndk-bundle/sources/sfml/include/)
 

And in root CMakelists.txt set include directories and linked libraries by hand:

include_directories(${SFML_INCLUDE_DIR}) # Force include directories anyway
set(SFML_LIBRARIES  sfml-graphics sfml-window sfml-system sfml-audio sfml-activity sfml-main)
link_directories (/media/sf_C_DRIVE/Android/ndk-bundle/sources/sfml/lib/armeabi-v7a)
 

But still for some reason one function was not found by the linker:

ast@lumo ~/src/Thor/build/armeabi-v7a $ make
Scanning dependencies of target thor
[  3%] Building CXX object src/CMakeFiles/thor.dir/BigTexture.cpp.o
Linking CXX shared library libthor.so
CMakeFiles/thor.dir/BigTexture.cpp.o:BigTexture.cpp:function thor::BigTexture::loadFromFile(std::string const&): error: undefined reference to 'sf::Image::loadFromFile(std::string const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/libthor.so] Error 1
make[1]: *** [src/CMakeFiles/thor.dir/all] Error 2
make: *** [all] Error 2
ast@lumo ~/src/Thor/build/armeabi-v7a $
 

After commenting call to this mystery function I got the Thor linked, less this one particular function, maybe I do not need it.  :D

bool BigTexture::loadFromFile(const std::string& filename)
{
        sf::Image image;
        //return image.loadFromFile(filename) && loadFromImage(image);
}
 

ast@lumo ~/src/Thor/build/armeabi-v7a $ make
Scanning dependencies of target thor
[  3%] Building CXX object src/CMakeFiles/thor.dir/BigTexture.cpp.o
Linking CXX shared library libthor.so
[100%] Built target thor
ast@lumo ~/src/Thor/build/armeabi-v7a $
 

It would be nice to know why the automatic find commands of cmake failed and created all this hassle.

 

6
General / Re: Using external libraries like Thor in Android build
« on: March 06, 2016, 10:30:53 pm »
It seems that find_path in FindSFML.cmake does not work for some reason. It becomes SFML_INCLUDE_DIR-NOTFOUND

# find the SFML include directory
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
          PATH_SUFFIXES include
          PATHS ${FIND_SFML_PATHS})
 

I overwrite it bluntly as

set(SFML_INCLUDE_DIR /media/sf_C_DRIVE/Android/ndk-bundle/sources/sfml/include/)
 

Then in Thor CMakeLists.txt SFML_FOUND is false and include directories are not set. If I set them anyway, as below, I get Thor compiled.

if(SFML_FOUND)
        include_directories(${SFML_INCLUDE_DIR})
else()
        set(SFML_ROOT "" CACHE PATH "SFML top-level directory")
        message("\n-> SFML directory not found. Set SFML_ROOT to SFML's top-level path (containing \"include\" and \"lib\" directories).")
        message("-> Make sure the SFML libraries with the same configuration (Release/Debug, Static/Dynamic) exist.\n")
endif()

include_directories(${SFML_INCLUDE_DIR}) # Force include directories anyway
 

The obect code is "ELF 32-bit LSB  relocatable, ARM, EABI5 version 1 (SYSV), not stripped", so looks good. However, the linking to the sfml libraries does not work. Probably it would if I knew cmake so well that I could pass the sfml-libraries to linker. Better yet, if I could figure out why find_path did not work, the same thing probably affects find_library as well. I am not very familiar with cmake and debugging is not terribly easy..  :)

7
General / Re: Bouncing Projectile
« on: March 05, 2016, 09:41:12 pm »
This seems pretty much a problem in the internal logic of your program and not so much related to SFML or any external parts. Solving these and get the code work is petty much the fun factor in programming  ;). I would suggest you to work little bit on the problematic area to gain more information on what is going on and where it goes differently than you'd think it should. Debugger might help or some debug code that print things on the console or draw additional things on the screen.

It is pretty difficult for anyone else to solve the problem without deeply diving into what internal logic you are trying to implement. Others most probably would like to implement the whole thing slightly differently.

Best regards,
ast

8
General / Re: Using external libraries like Thor in Android build
« on: March 05, 2016, 09:21:19 pm »
The SFML library objects are as follows:

ast@lumo /media/sf_C_DRIVE/Android/ndk-bundle/sources/sfml/lib/armeabi-v7a $ file *
libsfml-activity.so: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
libsfml-audio.so:    ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
libsfml-graphics.so: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
libsfml-main.a:      current ar archive
libsfml-network.so:  ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
libsfml-system.so:   ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
libsfml-window.so:   ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
ast@lumo /media/sf_C_DRIVE/Android/ndk-bundle/sources/sfml/lib/armeabi-v7a $
 

9
General / Re: Using external libraries like Thor in Android build
« on: March 05, 2016, 09:06:52 pm »
I am not familiar with android either. It seems the building of C++ is niche for android because it is all Java and also because the default build system is now gradle and android-studio it seems that I am trying to do some niche of niches and tutorials seem to concentrate on slightly different things.

Anyway, I have tried building Thor for android following the SFML guide. I first copied android.toolchain.cmake to Thor/cmake/toolchains. Attempt to generate makefiles results in notification that SFML is not found.

ast@lumo ~/src/Thor/build/armeabi-v7a $ cmake -DSFML_ROOT=/media/sf_C_DRIVE/Android/ndk-bundle/sources/sfml -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake ../..
Could NOT find SFML (missing:  SFML_AUDIO_LIBRARY SFML_GRAPHICS_LIBRARY SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY)

-> SFML directory not found. Set SFML_ROOT to SFML's top-level path (containing "include" and "lib" directories).
-> Make sure the SFML libraries with the same configuration (Release/Debug, Static/Dynamic) exist.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ast/src/Thor/build/armeabi-v7a
ast@lumo ~/src/Thor/build/armeabi-v7a $
 

I also have defined SFML_ROOT as environment variable but that did not help either. The SFML_ROOT directory contains SFML stuff that to me seems correct.

ast@lumo /media/sf_C_DRIVE/Android/ndk-bundle/sources/sfml $ du -l
5320    ./extlibs/lib/armeabi-v7a
5320    ./extlibs/lib
5321    ./extlibs
128     ./include/SFML/Audio
311     ./include/SFML/Graphics
125     ./include/SFML/Network
197     ./include/SFML/System
106     ./include/SFML/Window
892     ./include/SFML
892     ./include
3307    ./lib/armeabi-v7a
3307    ./lib
9528    .
ast@lumo /media/sf_C_DRIVE/Android/ndk-bundle/sources/sfml $
 

I use g++ that ships with Linux Mint and it can compile C++11 with flag -std=c++11.

10
General / Re: Using external libraries like Thor in Android build
« on: March 05, 2016, 07:18:09 am »
Would it be possible to just use gcc for arm and build libraries similarly to normal x86 linux things and copy the  resulting library objecs somewhere where android build can find them? If existing cmakelists could be reused would be great.

Or another way just to put the external library source code to same project as the code that uses it and compile and link them all all together. Definetly not the right thing to do but could work also.

11
General discussions / Re: Android Environment
« on: March 03, 2016, 09:50:34 pm »
You can install ndk to android studio. The selection is in menus or buttons, sdk manager if I recall correctly. After that it is possible to build ndk sample projects. This worked out out-of-the-box for me. But I do not know how to build sfml project with android studio or is it feasible at all. All the tutorials point to the standalone sdk and ndk. But the recent android documentation tells that android studio is the preferred way of building for android.

Best regards,
ast

12
General / Using external libraries like Thor in Android build
« on: March 03, 2016, 09:23:13 pm »
Hi all,

I am trying to build my SFML project for android and having some problems there.  I have successfully complied SFML for armeabi-v7a and also compiled the SFML example project and installed that on my android device. Works fine thanks to nice example:

https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android

There was a little bit of a hassle on how to install the Android SDK. The working solution was to use stand-alone SDK but to use ndk that came with android-studio. The standalone ndk somehow did not work. But anyway, the build system seems to be ok because I can build android binaries.

My project uses external libraries like Thor and sfml-tmxloader. Now the question is, how can I use these when building for android? I would think it is necessary to build these for armeabi-v7a target and install the libraries to ndk quite similar than in case of installing SFML to ndk. But how to do this?

I have googled around  and tried different things but no luck this far. Would be great if anyone could give some tips how to go forward.  :)

The other thing is how to set up an own android project. I have taken this as a starting point:
http://fr.sfml-dev.org/forums/index.php?topic=18211.msg131094#msg131094

The perfect solution would be to have the same source code in version control and build for PC or android but the android project setup seems to be quite different from normal cmake and this seems may become a problem. But I am not this far yet since I have not succeeded to build for android yet. Maybe the solution is to have the source files, resources etc in place where android wants them to be and try to have a cmake out of source build using the same resources. If anyone has experience on this, would love to hear as well :).

Best regards,
ast

13
General discussions / Re: How sfml compares with cocos2d-x?
« on: January 02, 2016, 12:39:03 am »
Ok, then I got roughly the right idea☺. Cocos2d-x seems to be kind of a superset of sfml, if you can opt not to use the game engine, for instance, if you dont like to. The main question is, is it so? Is this a trade off between true open source and kind of an open source and development efforts of a comunity vs salaried devs or are there technical issues also?

14
General discussions / How sfml compares with cocos2d-x?
« on: January 01, 2016, 11:53:23 pm »
Hi all,

I came across with the cocos2d-x, which I assume some of you have opinions on. I noticed that although it has MIT license it has companies around it making it to feel considerably less open than sfml. But the other side of the coin is that there seems to be more developers doing the cocos than sfml and also cocos has been used in many popular game titles.

The sfml is concentrated on abstracting window, keyboard, sound output etc and it does that very nicely. The cocos seem to have additional things also like some kind of a game engine and physics, support for Tiled tile map editor, support for particle system definitions in plist format and cocos studio for animations etc (no linux version though), texture atlas tools. Some of the aforementioned could be handy at times, the Tiled tilemaps work nicely with sfml with tmxloader (which I found after trying couple of others with less successful result) but I think there is no particle editor or support for plist particle definitions?

I understand that sfml and cocos have slightly different targets but I would appreciate if you could share your knowledge on the differences or pros and cons of the cocos and sfml. Also I would be interested to know how you find your way on the subjects where cocos has helper features (like the particle system editing)?

Best regards,
ast

15
General / Re: How to extend Thor particle system class? Monkey patching?
« on: October 21, 2015, 11:05:44 pm »
Exploiting the existing particle attribute yielded a working solution. It is easy to hide information in the lowes bits of particle scale so that no one notices. Originally I would have liked to store a little bit more information per particle but this 'lite' solution seem to work quite acceptably as well.

Pages: [1] 2
anything