Changeset 1944
- Timestamp:
- Sep 23, 2012, 5:35:24 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/platform/android/androidapp.cpp
r1684 r1944 36 36 JavaVM *g_vm; 37 37 jobject g_activity; 38 Queue<int> g_main_queue; 38 39 Thread *g_main_thread; 39 40 40 AndroidApp::AndroidApp(char const *title, ivec2 res, float fps) :41 41 AndroidApp::AndroidApp(char const *title, ivec2 res, float fps) 42 : data(0) 42 43 { 43 44 } … … 47 48 } 48 49 50 /* This is a fake Run() method. We just wait until we're called and 51 * signal nativeInit() that all the user's initialisation code was 52 * called. Then we sit here forever, the Java layer is in charge of 53 * calling TickDraw(). */ 49 54 void AndroidApp::Run() 50 55 { 56 g_main_queue.Push(1); 57 51 58 while (!Ticker::Finished()) 52 59 { 53 /* Tick the renderer, show the frame and clamp to desired framerate. */ 54 Ticker::TickDraw(); 60 /* Do nothing while the real render thread does the job. The 61 * real stuff happens in nativeRender() */ 62 Timer t; 63 t.Wait(0.5f); 55 64 } 56 65 } … … 86 95 Java_org_zoy_LolEngine_LolActivity_nativeInit(JNIEnv* env, jobject thiz) 87 96 { 97 Log::Info("Java layer initialising activity"); 88 98 env->NewGlobalRef(thiz); /* FIXME: never released! */ 89 99 g_activity = thiz; … … 93 103 Java_org_zoy_LolEngine_LolRenderer_nativeInit(JNIEnv* env) 94 104 { 95 Log::Info(" initialising renderer");105 Log::Info("Java layer initialising renderer"); 96 106 Ticker::Setup(30.0f); 97 107 Video::Setup(ivec2(320, 200)); 98 108 99 109 g_main_thread = new Thread(lol::AndroidApp::MainRun, NULL);; 110 g_main_queue.Pop(); 100 111 } 101 112 … … 104 115 jint w, jint h) 105 116 { 106 Log::Info(" resizing to %i x %i", w, h);117 Log::Info("Java layer resizing to %i x %i", w, h); 107 118 Video::Setup(ivec2(w, h)); 108 119 }
Note: See TracChangeset
for help on using the changeset viewer.