2013-07-18 17:27:50 +02:00
|
|
|
#include "ofMain.h"
|
2013-08-12 10:44:58 +09:00
|
|
|
#include "ofApp.h"
|
2013-07-18 17:27:50 +02:00
|
|
|
|
2025-04-03 05:03:36 +11:00
|
|
|
#ifdef TARGET_ANDROID
|
2013-07-18 17:27:50 +02:00
|
|
|
|
2025-04-03 05:03:36 +11:00
|
|
|
#include "ofWindowSettings.h"
|
|
|
|
|
#include "ofGLProgrammableRenderer.h"
|
|
|
|
|
|
|
|
|
|
shared_ptr<ofApp> *ofapp;
|
|
|
|
|
std::shared_ptr<ofAppBaseWindow> baseWindow;
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
|
baseWindow = std::make_shared<ofAppAndroidWindow>();
|
|
|
|
|
ofxAndroidWindowSettings settings;
|
|
|
|
|
settings.glesVersion = 2;
|
|
|
|
|
settings.setSize(1920, 1080);
|
|
|
|
|
settings.windowMode = OF_WINDOW;
|
|
|
|
|
settings.preserveContextOnPause = true;
|
|
|
|
|
baseWindow = ofCreateWindow(settings);
|
|
|
|
|
ofapp = new shared_ptr<ofApp>(new ofApp());
|
|
|
|
|
ofRunApp(baseWindow, *ofapp);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2013-07-18 17:27:50 +02:00
|
|
|
|
2016-02-22 15:44:16 +02:00
|
|
|
void ofAndroidApplicationInit()
|
2015-10-15 14:59:57 +03:00
|
|
|
{
|
2025-04-03 05:03:36 +11:00
|
|
|
//application scope init
|
2015-10-15 14:59:57 +03:00
|
|
|
}
|
2016-02-22 15:44:16 +02:00
|
|
|
void ofAndroidActivityInit()
|
2015-10-15 14:59:57 +03:00
|
|
|
{
|
2025-04-03 05:03:36 +11:00
|
|
|
//activity scope init - call main
|
|
|
|
|
main(0, nullptr);
|
2013-07-18 17:27:50 +02:00
|
|
|
}
|
2025-04-03 05:03:36 +11:00
|
|
|
|
|
|
|
|
// Callbacks from Android Layer
|
|
|
|
|
extern "C" JNIEXPORT void JNICALL
|
|
|
|
|
Java_cc_openframeworks_OFAndroid_init( JNIEnv* env, jclass clazz)
|
|
|
|
|
{
|
|
|
|
|
ofAndroidApplicationInit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" JNIEXPORT void JNICALL
|
|
|
|
|
Java_cc_openframeworks_OFAndroid_onCreate( JNIEnv* env, jclass clazz)
|
|
|
|
|
{
|
|
|
|
|
ofAndroidActivityInit();
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-18 17:27:50 +02:00
|
|
|
#endif
|