IPB Style© Fisana

Jump to content


Android port


  • Please log in to reply
218 replies to this topic

#41 Sonarpulse

Sonarpulse

  • Community Members
    PipPip

  • Sesquiplicarius
    (161 posts)

Posted 11 January 2012 - 01:43 AM

That's weird. How mature is the android port, it might be an idiosyncrasy of the developers, maybe it's this way to allow easy testing of multiple versions of SDL.
Posted ImagePosted ImagePosted Image

#42 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 11 January 2012 - 02:12 AM

View PostSonarpulse, on 11 January 2012 - 01:43 AM, said:

That's weird. How mature is the android port, it might be an idiosyncrasy of the developers, maybe it's this way to allow easy testing of multiple versions of SDL.
Indeed, the Android port is only available with SDL 1.3 which is not yet stable.

#43 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 11 January 2012 - 03:00 AM

So far, I've been able to get ndk-build to compile the game with SDL, Boost and SpiderMonkey. I am now down to this error output:

http://pastebin.ca/2102027

The OpenGL errors are to be expected, but I am not quite sure how to proceed with the others. Hints appreciated.

#44 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,928 posts)

Posted 11 January 2012 - 03:32 AM

View Postafeder, on 11 January 2012 - 03:00 AM, said:

So far, I've been able to get ndk-build to compile the game with SDL, Boost and SpiderMonkey. I am now down to this error output:

http://pastebin.ca/2102027
You don't have std::wstring, quick research led to conflicting suggestions as to whether it's possible to use wstring with NDK.
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#45 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 11 January 2012 - 04:06 AM

View Posthistoric_bruno, on 11 January 2012 - 03:32 AM, said:

You don't have std::wstring, quick research led to conflicting suggestions as to whether it's possible to use wstring with NDK.
Indeed, std::wstring appears not to be supported by the official NDK. Seems I have to use the Crystax NDK.

#46 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 12 January 2012 - 12:14 PM

I committed some changes to allow building with SDL 1.3 (at least on Linux), though it doesn't actually run correctly (the window size is bogus). Also you can run "SDL_CONFIG=$HOME/local/bin/sdl-config ./update-workspaces.sh" etc if you want to point it to a locally-installed copy of SDL, instead of using whatever the default sdl-config points to.

About OpenGL ES: Don't remember whether I've mentioned this before, but if not: I think the best approach is to extend graphics/ShaderProgram.cpp to support GLSL shaders (it was designed with that in mind, but I don't know if it'll actually work without some interface changes); then move all the renderer's existing fixed-function texture-environment setup code into ShaderProgramFFP.cpp and implement GLSL-based equivalents, so that most of the rest of the renderer code doesn't have to care whether it's using FFP or GLSL (it just uses the CShaderProgram interface). Also, change all immediate-mode drawing (glVertex3f etc) to vertex arrays. I think that should deal with the most serious problems, and the code would all be shared between GLES and desktop GL modes (no need for forking or #ifdefs etc) and can be tested with desktop GL. Then there's probably just lots of little issues remaining, which can be addressed as they occur.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#47 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 12 January 2012 - 04:38 PM

Thanks :)

#48 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 15 January 2012 - 11:29 PM

About OpenGL ES: On Linux you can compile Mesa with GLES support (on Gentoo you just do "USE=gles emerge mesa"), and I added some stuff so you can run "./update-workspaces.sh --gles" and build the game and get a zillion errors. I fixed errors in lib/ (except for ogl_shader.cpp which should be deleted once CShaderManager supports GLSL), mostly by #if'ing out the problematic things (since the rest of the game still depends on things that GLES doesn't support - should fix that later). Then I got bored - I'm not planning to make this actually work properly in practice, but hopefully it's a step in the right direction :)
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#49 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 16 January 2012 - 06:04 AM

Very good Posted Image I am now down to this error output, using Crystax NDK and the CONFIG2_GLES flag with the latest source.

#50 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 16 January 2012 - 08:57 AM

I managed to get rid of most of the errors with assert.h by defining BOOST_DISABLE_ASSERTS. Is this an acceptable solution or is there some reason that Boost's assertion stuff is enabled?

#51 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 16 January 2012 - 06:53 PM

The assert things just look like warnings, not errors, so they shouldn't be a problem and can be safely ignored.

If you're not running 'make' with the '-k' flag, you should probably add it (e.g. "make -k pyrogenesis config=debug" is probably the best thing for initial testing) and then you should get zillions more errors :)
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#52 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,928 posts)

Posted 16 January 2012 - 09:49 PM

View Postafeder, on 16 January 2012 - 06:04 AM, said:

Very good Posted Image I am now down to this error output, using Crystax NDK and the CONFIG2_GLES flag with the latest source.
I guess NDK doesn't provide POSIX asynchronous I/O either, maybe look into using Boost.Asio? If you look at posix_aio.h, we already emulate it on Windows (waio.h/cpp), so perhaps you could use Boost to provide the same interface? Doesn't sound trivial to me :/ Maybe AIO can be avoided in your case. I'm guessing Jan wrote all that code, maybe you could ask him for advice.
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#53 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 16 January 2012 - 10:40 PM

I think we don't use async IO on Linux anyway (because a kernel bug broke it, and it provides little benefit) - sync IO works well enough. I expect we can get rid of the build errors by possibly moving some code into "#if CONFIG2_FILE_ENABLE_AIO" blocks, and possibly by defining some macros (LIO_READ etc) and structs (aiocb etc) ourselves when the platform doesn't provide them.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#54 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,928 posts)

Posted 16 January 2012 - 10:58 PM

Good to know, that simplifies things a bit :)
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#55 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 17 January 2012 - 01:09 PM

View PostYkkrosh, on 16 January 2012 - 06:53 PM, said:

The assert things just look like warnings, not errors, so they shouldn't be a problem and can be safely ignored.

If you're not running 'make' with the '-k' flag, you should probably add it (e.g. "make -k pyrogenesis config=debug" is probably the best thing for initial testing) and then you should get zillions more errors :)
*reloads shotgun* Bring it.

Doesn't seem too bad. Maybe it was overwhelmed and broke down Posted Image

#56 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 17 January 2012 - 01:40 PM

View PostYkkrosh, on 16 January 2012 - 10:40 PM, said:

I think we don't use async IO on Linux anyway (because a kernel bug broke it, and it provides little benefit) - sync IO works well enough. I expect we can get rid of the build errors by possibly moving some code into "#if CONFIG2_FILE_ENABLE_AIO" blocks, and possibly by defining some macros (LIO_READ etc) and structs (aiocb etc) ourselves when the platform doesn't provide them.
Can you elaborate on how you think this should be approached? What parts of the code should be put into "#if CONFIG2_FILE_ENABLE_AIO" blocks, how should it detect whether the platform provides the relevant macros and structs, etc.?

#57 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 17 January 2012 - 10:08 PM

You should do this :). Also, it looks like you're setting up ndk-build to only build main.cpp and none of the rest of the game - it'd probably be better to build with Premake as normal, like here (though that'll need lots of fixes to support cross-compilation before it'll work for real; but at least it gets far enough to highlight lots of build fixes that will need fixing first).
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#58 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 18 January 2012 - 05:14 AM

View PostYkkrosh, on 17 January 2012 - 10:08 PM, said:

You should do this :). Also, it looks like you're setting up ndk-build to only build main.cpp and none of the rest of the game - it'd probably be better to build with Premake as normal, like here (though that'll need lots of fixes to support cross-compilation before it'll work for real; but at least it gets far enough to highlight lots of build fixes that will need fixing first).
Great. That should keep me busy.

#59 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 20 January 2012 - 12:33 PM

View PostYkkrosh, on 17 January 2012 - 10:08 PM, said:

You should do this :). Also, it looks like you're setting up ndk-build to only build main.cpp and none of the rest of the game - it'd probably be better to build with Premake as normal, like here (though that'll need lots of fixes to support cross-compilation before it'll work for real; but at least it gets far enough to highlight lots of build fixes that will need fixing first).
When I run update-workspaces.sh, I get the following error:
afeder@ubuntu:~/android/0ad/build/workspaces$ ./update-workspaces.sh --gles
Updating bundled third-party dependencies...

bash -c 'mkdir -p output/{debug,release,test}/{FCollada/{FCDocument,FMath,FUtils,FColladaTest/{FCTestAssetManagement,FCTestExportImport,FCTestXRef}},FColladaPlugins/FArchiveXML}'
cp output/libFColladaSD.a ../lib/libFColladaSD.a
cp output/libFColladaSR.a ../lib/libFColladaSR.a

Building SpiderMonkey...

SpiderMonkey build options: --disable-tests 		
loading cache ./config.cache
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
checking for mawk... mawk
checking for perl5... no
checking for perl... /usr/bin/perl
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for c++... arm-linux-androideabi-g++
checking whether the C++ compiler (arm-linux-androideabi-g++  ) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.
ERROR: SpiderMonkey build failed
This is the config.log: http://pastebin.com/5AFZG4CX

It says "eval: 1: arm-linux-androideabi-g++: not found", but if I run "arm-linux-androideabi-g++" from the command-line, it finds it well enough, so the PATH should be set up correctly.

Edited by afeder, 20 January 2012 - 01:01 PM.


#60 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 20 January 2012 - 01:48 PM

You should run update-workspaces.sh after setting HOSTTYPE, but before setting PATH or CXX or anything else. That will build the bundled libraries (SpiderMonkey etc) like in a normal non-Android build with the standard x86/amd64 version of GCC - those libraries won't be usable by an Android version of the game but we can deal with that problem later once the game's compile errors are fixed.

Then set PATH and CXX, and run the 'make' command from inside workspaces/gcc/ (like in a normal build of the game, except now it's using the Android compiler).
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users