- Added ads support for Android
- basic "message" system between JGE and java through jni - Fixed pause/resume on android/sdl
This commit is contained in:
@@ -315,6 +315,11 @@ JGE::JGE()
|
||||
strcpy(mDebuggingMsg, "");
|
||||
mCurrentMusic = NULL;
|
||||
#endif
|
||||
|
||||
#if defined (ANDROID)
|
||||
mJNIEnv = NULL;
|
||||
#endif
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
@@ -567,5 +572,29 @@ void JGE::Scroll(int inXVelocity, int inYVelocity)
|
||||
}
|
||||
}
|
||||
|
||||
void JGE::SendCommand(string command)
|
||||
{
|
||||
#if defined (ANDROID)
|
||||
sendJNICommand(command);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (ANDROID)
|
||||
/// Access to JNI Environment
|
||||
void JGE::SetJNIEnv(JNIEnv * env, jclass cls)
|
||||
{
|
||||
mJNIEnv = env;
|
||||
mJNIClass = cls;
|
||||
midSendCommand = mJNIEnv->GetStaticMethodID(mJNIClass,"jgeSendCommand","(Ljava/lang/String;)V");
|
||||
}
|
||||
|
||||
void JGE::sendJNICommand(string command)
|
||||
{
|
||||
if (midSendCommand) {
|
||||
mJNIEnv->CallStaticVoidMethod(mJNIClass, midSendCommand, mJNIEnv->NewStringUTF(command.c_str()));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::queue< pair< pair<LocalKeySym, JButton>, bool> > JGE::keyBuffer;
|
||||
std::multimap<LocalKeySym, JButton> JGE::keyBinds;
|
||||
|
||||
Reference in New Issue
Block a user