zenilib
0.5.3.0
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
SDL_android_main.cpp
Go to the documentation of this file.
1
2
#include "
SDL_config.h
"
3
4
#ifdef __ANDROID__
5
6
/* Include the SDL main definition header */
7
#include "
SDL_main.h
"
8
9
/*******************************************************************************
10
Functions called by JNI
11
*******************************************************************************/
12
#include <jni.h>
13
14
// Called before SDL_main() to initialize JNI bindings in SDL library
15
extern
"C"
void
SDL_Android_Init(JNIEnv*
env
, jclass cls);
16
17
// Start up the SDL app
18
extern
"C"
void
Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv*
env
, jclass cls, jobject
obj
)
19
{
20
/* This interface could expand with ABI negotiation, calbacks, etc. */
21
SDL_Android_Init(env, cls);
22
23
/* Run the application code! */
24
int
status;
25
char
*argv[2];
26
argv[0] =
strdup
(
"SDL_app"
);
27
argv[1] =
NULL
;
28
status =
SDL_main
(1, argv);
29
30
/* Do not issue an exit or the whole application will terminate instead of just the SDL thread */
31
//exit(status);
32
}
33
34
#endif
/* __ANDROID__ */
35
36
/* vi: set ts=4 sw=4 expandtab: */
strdup
char * strdup(const char *inStr)
Definition:
strdup.c:6
NULL
#define NULL
Definition:
ftobjs.h:61
SDL_config.h
obj
GLhandleARB obj
Definition:
glew.h:5621
env
jmp_buf env
Definition:
jumphack.c:12
SDL_main.h
SDL_main
C_LINKAGE int SDL_main(int argc, char *argv[])
zenilib
jni
external
sdl
src
main
android
SDL_android_main.cpp
Generated on Thu Oct 3 2013 19:56:34 for zenilib by
1.8.5