Selaa lähdekoodia

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

the loop to complete.
legacy
Sam Hocevar sam 14 vuotta sitten
vanhempi
commit
a156dd810e
2 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. +2
    -0
      src/gtk/editor.cpp
  2. +1
    -0
      src/ticker.cpp

+ 2
- 0
src/gtk/editor.cpp Näytä tiedosto

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




+ 1
- 0
src/ticker.cpp Näytä tiedosto

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

Profiler::Start(Profiler::STAT_TICK_GAME); Profiler::Start(Profiler::STAT_TICK_GAME);


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


||||||
x
 
000:0
Ladataan…
Peruuta
Tallenna