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/sdl/sdlapp.cpp

    r2183 r2222  
    110110}
    111111
    112 void SdlApp::Run()
     112void SdlApp::Tick()
    113113{
    114     while (!Ticker::Finished())
    115     {
    116114#if defined USE_SDL && defined USE_D3D9
    117         HRESULT hr;
    118         hr = g_d3ddevice->BeginScene();
    119         if (FAILED(hr))
    120             Abort();
     115    HRESULT hr;
     116    hr = g_d3ddevice->BeginScene();
     117    if (FAILED(hr))
     118        Abort();
    121119#endif
    122         /* Tick the renderer, show the frame and clamp to desired framerate. */
    123         Ticker::TickDraw();
     120    /* Tick the renderer, show the frame and clamp to desired framerate. */
     121    Ticker::TickDraw();
    124122#if defined USE_SDL
    125123#   if defined USE_D3D9
    126         hr = g_d3ddevice->EndScene();
    127         if (FAILED(hr))
    128             Abort();
    129         hr = g_d3ddevice->Present(NULL, NULL, NULL, NULL);
    130         if (FAILED(hr))
    131             Abort();
     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();
    132130#   else
    133         SDL_GL_SwapBuffers();
     131    SDL_GL_SwapBuffers();
    134132#   endif
    135133#endif
    136     }
    137134}
    138135
Note: See TracChangeset for help on using the changeset viewer.