瀏覽代碼

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

the loop to complete.
legacy
Sam Hocevar sam 14 年之前
父節點
當前提交
a156dd810e
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. +2
    -0
      src/gtk/editor.cpp
  2. +1
    -0
      src/ticker.cpp

+ 2
- 0
src/gtk/editor.cpp 查看文件

@@ -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 查看文件

@@ -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();


Loading…
取消
儲存