• Advertisement
Sign in to follow this  

Android NDK Native Activity + Game Engine

This topic is 1924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

// 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

if (!game->Initialize()) {
ErrorDialog("Aurora", context->GetSubsystem<Log>()->GetLastMessage());
} else {
while (!game->IsExiting()) {


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

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement