Sfoglia il codice sorgente

Make the editor more responsive by handling GTK events before waiting for

the loop to complete.
legacy
Sam Hocevar sam 14 anni fa
parent
commit
a156dd810e
2 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. +2
    -0
      src/gtk/editor.cpp
  2. +1
    -0
      src/ticker.cpp

+ 2
- 0
src/gtk/editor.cpp Vedi File

@@ -82,6 +82,8 @@ static gint draw(GtkWidget *widget, GdkEventExpose *event)
Video::Clear();
Ticker::TickRender();
gtk_gl_area_swapbuffers(GTK_GL_AREA(widget));
while (g_main_context_iteration(NULL, FALSE))
;
Ticker::ClampFps(FPS);
}



+ 1
- 0
src/ticker.cpp Vedi File

@@ -73,6 +73,7 @@ void Ticker::TickGame()
{
Profiler::Stop(Profiler::STAT_TICK_FRAME);
Profiler::Start(Profiler::STAT_TICK_FRAME);

Profiler::Start(Profiler::STAT_TICK_GAME);

data->delta_time = data->timer.GetSeconds();


Caricamento…
Annulla
Salva