Changeset 2222
- Timestamp:
- Jan 15, 2013, 11:41:52 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/application/application.cpp
r2216 r2222 71 71 } 72 72 73 bool Application::MustTick() 74 { 75 return !Ticker::Finished(); 76 } 77 78 void Application::Tick() 79 { 80 data->app.Tick(); 81 } 82 73 83 void Application::ShowPointer(bool show) 74 84 { 75 85 data->app.ShowPointer(show); 76 }77 78 void Application::Run()79 {80 data->app.Run();81 86 } 82 87 -
trunk/src/application/application.h
r2183 r2222 28 28 ~Application(); 29 29 30 bool MustTick(); 31 void Tick(); 32 33 void Run() { while(MustTick()) Tick(); } 34 30 35 void ShowPointer(bool show); 31 void Run();32 36 33 37 private: -
trunk/src/eglapp.cpp
r2183 r2222 268 268 } 269 269 270 void EglApp::Run() 271 { 272 while (!Ticker::Finished()) 273 { 274 /* Tick the renderer, show the frame and clamp to desired framerate. */ 275 Ticker::TickDraw(); 276 #if defined USE_EGL && !defined __ANDROID__ 277 eglSwapBuffers(data->egl_dpy, data->egl_surf); 278 #endif 279 } 270 void EglApp::Tick() 271 { 272 /* Tick the renderer, show the frame and clamp to desired framerate. */ 273 Ticker::TickDraw(); 274 #if defined USE_EGL && !defined __ANDROID__ 275 eglSwapBuffers(data->egl_dpy, data->egl_surf); 276 #endif 280 277 } 281 278 -
trunk/src/eglapp.h
r2183 r2222 31 31 32 32 void ShowPointer(bool show); 33 void Run();33 void Tick(); 34 34 35 35 private: -
trunk/src/platform/android/androidapp.cpp
r2183 r2222 47 47 } 48 48 49 /* This is a fake Run() method. We just wait until we're called and49 /* This is a fake Tick() method. We just wait until we're called and 50 50 * signal nativeInit() that all the user's initialisation code was 51 51 * called. Then we sit here forever, the Java layer is in charge of 52 52 * calling TickDraw(). */ 53 void AndroidApp:: Run()53 void AndroidApp::Tick() 54 54 { 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 } 57 62 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); 65 67 } 66 68 -
trunk/src/platform/android/androidapp.h
r2183 r2222 31 31 32 32 void ShowPointer(bool show); 33 void Run();33 void Tick(); 34 34 35 35 static void *MainRun(void *data); -
trunk/src/platform/nacl/nacl-app.cpp
r2183 r2222 51 51 } 52 52 53 void NaClApp:: Run()53 void NaClApp::Tick() 54 54 { 55 /* The caller should run forever */ 55 56 #if defined __native_client__ 56 NaClInstance::MainSignal(); 57 static int init = 0; 58 if (!init) 59 { 60 NaClInstance::MainSignal(); 61 init = 1; 62 } 57 63 #endif 58 59 /* Wait forever */60 Queue<int, 1> q;61 q.Pop();62 64 } 63 65 -
trunk/src/platform/nacl/nacl-app.h
r2183 r2222 31 31 32 32 void ShowPointer(bool show); 33 void Run();33 void Tick(); 34 34 35 35 private: -
trunk/src/platform/ps3/ps3app.cpp
r2183 r2222 115 115 } 116 116 117 void Ps3App:: Run()117 void Ps3App::Tick() 118 118 { 119 while (!Ticker::Finished()) 120 { 121 /* Tick the renderer, show the frame and clamp to desired framerate. */ 122 Ticker::TickDraw(); 119 /* Tick the renderer, show the frame and clamp to desired framerate. */ 120 Ticker::TickDraw(); 123 121 124 122 #if defined __CELLOS_LV2__ 125 123 psglSwap(); 126 124 127 128 125 /* Check if exit callback was called */ 126 cellSysutilCheckCallback(); 129 127 #endif 130 }131 128 } 132 129 -
trunk/src/platform/ps3/ps3app.h
r2183 r2222 31 31 32 32 void ShowPointer(bool show); 33 void Run();33 void Tick(); 34 34 35 35 private: -
trunk/src/platform/sdl/sdlapp.cpp
r2183 r2222 110 110 } 111 111 112 void SdlApp:: Run()112 void SdlApp::Tick() 113 113 { 114 while (!Ticker::Finished())115 {116 114 #if defined USE_SDL && defined USE_D3D9 117 118 119 120 115 HRESULT hr; 116 hr = g_d3ddevice->BeginScene(); 117 if (FAILED(hr)) 118 Abort(); 121 119 #endif 122 123 120 /* Tick the renderer, show the frame and clamp to desired framerate. */ 121 Ticker::TickDraw(); 124 122 #if defined USE_SDL 125 123 # if defined USE_D3D9 126 127 128 129 130 131 124 hr = g_d3ddevice->EndScene(); 125 if (FAILED(hr)) 126 Abort(); 127 hr = g_d3ddevice->Present(NULL, NULL, NULL, NULL); 128 if (FAILED(hr)) 129 Abort(); 132 130 # else 133 131 SDL_GL_SwapBuffers(); 134 132 # endif 135 133 #endif 136 }137 134 } 138 135 -
trunk/src/platform/sdl/sdlapp.h
r2183 r2222 31 31 32 32 void ShowPointer(bool show); 33 void Run();33 void Tick(); 34 34 35 35 private: -
trunk/src/platform/xbox/xboxapp.cpp
r2183 r2222 62 62 } 63 63 64 void XboxApp:: Run()64 void XboxApp::Tick() 65 65 { 66 while (!Ticker::Finished()) 67 { 68 /* Tick the renderer, show the frame and clamp to desired framerate. */ 69 Ticker::TickDraw(); 66 /* Tick the renderer, show the frame and clamp to desired framerate. */ 67 Ticker::TickDraw(); 70 68 71 69 #if defined _XBOX 72 70 g_d3ddevice->Present(NULL, NULL, NULL, NULL); 73 71 #endif 74 }75 72 } 76 73 -
trunk/src/platform/xbox/xboxapp.h
r2216 r2222 31 31 32 32 void ShowPointer(bool show); 33 void Run();33 void Tick(); 34 34 35 35 private:
Note: See TracChangeset
for help on using the changeset viewer.