Created
January 1, 2013 08:33
-
-
Save coderarity/4425929 to your computer and use it in GitHub Desktop.
Awesome lack of Java on android! I am pleased.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html | |
void android_main(struct android_app* state) { | |
// Make sure glue isn't stripped. | |
app_dummy(); | |
// loop waiting for stuff to do. | |
while (1) { | |
// Read all pending events. | |
int ident; | |
int events; | |
struct android_poll_source* source; | |
// Read events and draw a frame of animation. | |
if ((ident = ALooper_pollAll(0, NULL, &events, | |
(void**)&source)) >= 0) { | |
// Process this event. | |
if (source != NULL) { | |
source->process(state, source); | |
} | |
} | |
// draw a frame of animation | |
bringTheAwesome(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment