Jump to content

  • Log In with Google      Sign In   
  • Create Account


Android NDK Native Activity + Game Engine


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 NiteLordz   Members   -  Reputation: 369

Like
0Likes
Like

Posted 13 October 2012 - 01:28 PM

I have an engine that is running on the pc quite well. I am trying to get it to run on Android now using NativeAcitivity. I had it ported using SDL and was ok, but wanted to get away from SDL. so i implemented the native activity example but my problem is now i believe threading...

my android main is setup much like the one in SDL is,

[source lang="cpp"]void android_main(struct android_app* state) { // Make sure glue isn't stripped. app_dummy(); // Store our state for later use __state = state; // Create the execution context and the engine SharedPtr<Context> context(new Context()); SharedPtr<Engine> engine(new Engine(context)); // Give the game object the engine context game->SetContext(context); game->SetEngine(engine); if (!game->Initialize()) { ErrorDialog("Aurora", context->GetSubsystem<Log>()->GetLastMessage()); } else { while (!game->IsExiting()) { game->Run(); } } return;}[/source]

then once inside of game initialize, i have the engine startup, and fire off the needed subsystems. however, i am getting things loaded prior to when they are supposed to be loaded. even when i purposely BLOCK them using an infinite loop, they still get executed as if a second thread has fired, creating a second engine, and thus filling in the values. i am not really sure what is going on and was hoping someone could point me in a direction for help.

thanks much
Code makes the man

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS