Ignore:
Timestamp:
Jan 15, 2013, 11:41:52 PM (8 years ago)
Author:
sam
Message:

core: you can now while(app.MustTick()) { Tick(); } instead of app.Run().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/platform/android/androidapp.cpp

    r2183 r2222  
    4747}
    4848
    49 /* This is a fake Run() method. We just wait until we're called and
     49/* This is a fake Tick() method. We just wait until we're called and
    5050 * signal nativeInit() that all the user's initialisation code was
    5151 * called. Then we sit here forever, the Java layer is in charge of
    5252 * calling TickDraw(). */
    53 void AndroidApp::Run()
     53void AndroidApp::Tick()
    5454{
    55     g_main_queue.Push(1);
    56     g_main_queue.Push(1);
     55    static int init = 0;
     56    if (!init)
     57    {
     58        init = 1;
     59        g_main_queue.Push(1);
     60        g_main_queue.Push(1);
     61    }
    5762
    58     while (!Ticker::Finished())
    59     {
    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);
    64     }
     63    /* Do nothing while the real render thread does the job. The
     64     * real stuff happens in nativeRender() */
     65    Timer t;
     66    t.Wait(0.5f);
    6567}
    6668
Note: See TracChangeset for help on using the changeset viewer.