Port Ogre to Android?
-
Assaf Raman
- OGRE Team Member

- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: Port Ogre to Android?
Look here: Android NDK add stlport and compile C++ program.
BTW: OGRE does support compiling with stlport.
BTW: OGRE does support compiling with stlport.
Watch out for my OGRE related tweets here.
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
But STLport supports full exceptions stuff? why don't we use STLport with the official NDK and compile ogre with it?
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
Assaf Raman
- OGRE Team Member

- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: Port Ogre to Android?
I think that the compiler that comes with Android doesn't support exceptions.
I am not an expert.
I am not an expert.
Watch out for my OGRE related tweets here.
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
Well, then I'll try to compile STLport with my compiled compiler. It should work the same way. But we could try to see if we can use the regular android compiler and use STLport for exceptions. Probably not since there are some flags unset etc.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
Assaf Raman
- OGRE Team Member

- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: Port Ogre to Android?
exceptions are part of the compiler and not the STL as far as I know...
Watch out for my OGRE related tweets here.
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
http://android.git.kernel.org/?p=platfo ... 34;hb=HEAD 
When I get the libstdc++ compiled I'm gonna try compiling hello-jni (since that uses libstdc++ anyway) and if that works in the emulator I'm going to compile the gl es lib + the san angeles demo app.
When I get the libstdc++ compiled I'm gonna try compiling hello-jni (since that uses libstdc++ anyway) and if that works in the emulator I'm going to compile the gl es lib + the san angeles demo app.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
Assaf Raman
- OGRE Team Member

- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: Port Ogre to Android?
I am not sure if exceptions are an OS feature or a compiler feature... what do you think?
Watch out for my OGRE related tweets here.
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
I think compiler feature and libsupc++ feature, but:



Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
Assaf Raman
- OGRE Team Member

- Posts: 3092
- Joined: Tue Apr 11, 2006 3:58 pm
- Location: TLV, Israel
- x 76
Re: Port Ogre to Android?
I am not sure - possibly the code in the compiler assumes that some OS interrupt exist...
Watch out for my OGRE related tweets here.
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
Yes, they say the Dalvik VM (the exe runner for Android) should support it too. Online they say that you could use the Dalvik VM to execute the JNI function ThrowNew which causes a java exception to occur. So that a real exception is caused in the application. Dunno if this works that way though.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
liberator
- Greenskin
- Posts: 117
- Joined: Mon Jan 24, 2005 2:27 pm
- Location: Sillicon Valley, California
Re: Port Ogre to Android?
C++ exceptions should not cross over into the Java realm so it does not matter whether the DalvikVM supports exceptions for compiling/running native C++ exception enable code. Any exception should be caught within the native module and not allowed to go beyond it. So I am confused as to why java exceptions have anything to do with this nor DalvikVM features?calsmurf2904 wrote:Yes, they say the Dalvik VM (the exe runner for Android) should support it too. Online they say that you could use the Dalvik VM to execute the JNI function ThrowNew which causes a java exception to occur. So that a real exception is caused in the application. Dunno if this works that way though.
Project lead and developer of:
http://sourceforge.net/projects/gucef
http://sourceforge.net/projects/guce
Etc.
LinkedIn: http://www.linkedin.com/in/dinandvanvelzen
http://sourceforge.net/projects/gucef
http://sourceforge.net/projects/guce
Etc.
LinkedIn: http://www.linkedin.com/in/dinandvanvelzen
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
Well, the application normally allows java exceptions which cause the app to exit. When linking with C++ Native code you need the C runtime to be able to stop the app too when an uncaught exception is found. This could be done by just making the exception implementation in the C runtime call the java exception implementation so that the java runtime quits.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
liberator
- Greenskin
- Posts: 117
- Joined: Mon Jan 24, 2005 2:27 pm
- Location: Sillicon Valley, California
Re: Port Ogre to Android?
Translating the exception from native to Java is one way to go but I myself would choose to go with return values at the native/java boundary which would eliminate the need to do any exception translation work and reliance on Dalvik's exceptions. Either case,.. I guess that's an application development choice which can be made independent of the question of how to get a native Ogre onto Android.
Project lead and developer of:
http://sourceforge.net/projects/gucef
http://sourceforge.net/projects/guce
Etc.
LinkedIn: http://www.linkedin.com/in/dinandvanvelzen
http://sourceforge.net/projects/gucef
http://sourceforge.net/projects/guce
Etc.
LinkedIn: http://www.linkedin.com/in/dinandvanvelzen
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
True, this would mean we won't need to change anything in the OS itself. Only at the application-side. (libc etc.). Which I already done (I already compiled newlib, so that stands in for libc and libm and I compiled libstdc++ which fills in the exceptions stuff etc). I only need to test it out.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
I can't seem to be able to compile the hello-jni app since I need to use androids build system, so I need to adapt my toolchain to use their directory and filename structure. I'm gonna do it in the weekend so that I can finally test it out 
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
Praetor
- OGRE Retired Team Member

- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
Re: Port Ogre to Android?
You're making some amazing progress. Thanks for pushing ahead. When I ran into the C++ wall I gave up. Thanks for having more courage than me.
Game Development, Engine Development, Porting
http://www.darkwindmedia.com
http://www.darkwindmedia.com
-
ethan
- Gnoblar
- Posts: 6
- Joined: Tue Feb 26, 2008 5:19 pm
- Location: Nice (France)
Re: Port Ogre to Android?
Hey,
I just discovered this topic. I want you to know I fully support you. I would be very glad to have ogre ported to android.
They did this for the iPhone, so we should have it too!
I can offer my help, but if I don't have specific knowledge in this area. Nevertheless I would be very glad to contribute.
I am closely following this thread now. Thanks and keep going with the good work
I just discovered this topic. I want you to know I fully support you. I would be very glad to have ogre ported to android.
They did this for the iPhone, so we should have it too!
I can offer my help, but if I don't have specific knowledge in this area. Nevertheless I would be very glad to contribute.
I am closely following this thread now. Thanks and keep going with the good work
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
ethan wrote:Hey,
I just discovered this topic. I want you to know I fully support you. I would be very glad to have ogre ported to android.
They did this for the iPhone, so we should have it too!
I can offer my help, but if I don't have specific knowledge in this area. Nevertheless I would be very glad to contribute.
I am closely following this thread now. Thanks and keep going with the good work
Thanks! Now it would suck if the compiler generated executables won't run lol.Praetor wrote:You're making some amazing progress. Thanks for pushing ahead. When I ran into the C++ wall I gave up. Thanks for having more courage than me.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
or when this happens:calsmurf2904 wrote:ethan wrote:Hey,
I just discovered this topic. I want you to know I fully support you. I would be very glad to have ogre ported to android.
They did this for the iPhone, so we should have it too!
I can offer my help, but if I don't have specific knowledge in this area. Nevertheless I would be very glad to contribute.
I am closely following this thread now. Thanks and keep going with the good workThanks! Now it would suck if the compiler generated executables won't run lol.Praetor wrote:You're making some amazing progress. Thanks for pushing ahead. When I ran into the C++ wall I gave up. Thanks for having more courage than me.
Code: Select all
$ make APP=hello-jni
Android NDK: Building for application 'hello-jni'
Compile thumb : hello-jni <= apps/hello-jni/project/jni/hello-jni.c
Assembler messages:
Fatal error: Invalid -march= option: `armv5te'
make: *** [out/apps/hello-jni//objs/hello-jni/hello-jni.o] Error 1
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
SomeFusion
- Gremlin
- Posts: 191
- Joined: Sun Dec 01, 2002 12:38 am
- x 3
Re: Port Ogre to Android?
If somebody is going to attend GDC this year you might attend the Android lessons there. Google is also giving away free phones to attendees:
http://android-developers.blogspot.com/ ... opers.html
http://android-developers.blogspot.com/ ... opers.html
Summoning Wars is an open source role-playing game, featuring both a single-player and a multiplayer mode for about 2 to 8 players.
http://www.sumwars.org
http://www.sumwars.org
-
liberator
- Greenskin
- Posts: 117
- Joined: Mon Jan 24, 2005 2:27 pm
- Location: Sillicon Valley, California
Re: Port Ogre to Android?
Its next-door for me,.. but I'm not going,.. have you seen the price of the passes??? OMG 1400$ for all access.SomeFusion wrote:If somebody is going to attend GDC this year you might attend the Android lessons there. Google is also giving away free phones to attendees:
http://android-developers.blogspot.com/ ... opers.html
Project lead and developer of:
http://sourceforge.net/projects/gucef
http://sourceforge.net/projects/guce
Etc.
LinkedIn: http://www.linkedin.com/in/dinandvanvelzen
http://sourceforge.net/projects/gucef
http://sourceforge.net/projects/guce
Etc.
LinkedIn: http://www.linkedin.com/in/dinandvanvelzen
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
A-side when the part where its about 1400km away from meSomeFusion wrote:If somebody is going to attend GDC this year you might attend the Android lessons there. Google is also giving away free phones to attendees:
http://android-developers.blogspot.com/ ... opers.html
Anyway, I've been on a small vacation so I haven't worked on this much, resting now, gonna work on it starting tomorrow.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
liberator
- Greenskin
- Posts: 117
- Joined: Mon Jan 24, 2005 2:27 pm
- Location: Sillicon Valley, California
Re: Port Ogre to Android?
Any news?
I'm eagerly awaiting the outcome of your experiment
I'm eagerly awaiting the outcome of your experiment
Project lead and developer of:
http://sourceforge.net/projects/gucef
http://sourceforge.net/projects/guce
Etc.
LinkedIn: http://www.linkedin.com/in/dinandvanvelzen
http://sourceforge.net/projects/gucef
http://sourceforge.net/projects/guce
Etc.
LinkedIn: http://www.linkedin.com/in/dinandvanvelzen
-
calsmurf2904
- Orc
- Posts: 401
- Joined: Tue Sep 16, 2008 9:39 pm
- Location: Netherlands
Re: Port Ogre to Android?
Sorry
Some private stuff happened, I'll be on it soon. I would probably have to recompile the compiler (I keep thinking that sentence sounds a bit ironic?
like who was there first? the chicken or the egg) with some good settings. (Mainly the thumb-interwork stuff, which I didn't add a flag for :/)
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)

-
fredguinog
- Gnoblar
- Posts: 5
- Joined: Tue Feb 02, 2010 3:51 am
Re: Port Ogre to Android?
Hi Guys,
Since I'm also interested creating games using Ogre in Android device, I was taking a look at this thread and by luck I noticed a link to a post in google's forum about ndk which may be interesting for you.
http://groups.google.com/group/android- ... ed1fbf6450
I'll just copy what Dimitry wrote there:
"Hi all,
I've built my own version of android ndk which support full C++
standard library (including STL), exceptions and RTTI. I did it using
official ndk build scripts and sources, just little patched them.
Actually I was wonder how easy it was. I've used exceptions in massive
piece of code which I have now ported to android (libstdc++ linked
statically) and seems all works fine.
Only linux and darwin variants ready for now -
http://www.crystax.net/data/android-ndk ... ax.tar.bz2,
http://www.crystax.net/data/android-ndk ... rystax.tar....
Diff I've created to build customized ndk -
http://www.crystax.net/data/android-ndk ... ystax.diff.
Hope it would help to you guys
"
And:
"Hi,
Just want to inform that windows build is also done - http://www.crystax.net/data/android-ndk ... rystax.zip
Dmitry Moskalchuk "
I hope it helps. Cheers,
Fred
Since I'm also interested creating games using Ogre in Android device, I was taking a look at this thread and by luck I noticed a link to a post in google's forum about ndk which may be interesting for you.
http://groups.google.com/group/android- ... ed1fbf6450
I'll just copy what Dimitry wrote there:
"Hi all,
I've built my own version of android ndk which support full C++
standard library (including STL), exceptions and RTTI. I did it using
official ndk build scripts and sources, just little patched them.
Actually I was wonder how easy it was. I've used exceptions in massive
piece of code which I have now ported to android (libstdc++ linked
statically) and seems all works fine.
Only linux and darwin variants ready for now -
http://www.crystax.net/data/android-ndk ... ax.tar.bz2,
http://www.crystax.net/data/android-ndk ... rystax.tar....
Diff I've created to build customized ndk -
http://www.crystax.net/data/android-ndk ... ystax.diff.
Hope it would help to you guys
And:
"Hi,
Just want to inform that windows build is also done - http://www.crystax.net/data/android-ndk ... rystax.zip
Dmitry Moskalchuk "
I hope it helps. Cheers,
Fred