remove all async_start/end calls
This commit is contained in:
40
src/main.cpp
40
src/main.cpp
@@ -811,7 +811,7 @@ void render_thread_main()
|
||||
async_lock();
|
||||
while (!working_list.empty())
|
||||
{
|
||||
//LOG("render task %d", count);
|
||||
LOG("render task %d", count);
|
||||
count++;
|
||||
working_list.front()();
|
||||
working_list.pop_front();
|
||||
@@ -1133,11 +1133,12 @@ int main(int argc, char** argv)
|
||||
|
||||
if (App::I.redraw)
|
||||
{
|
||||
App::I.update(frame_timer);
|
||||
render_task([frame_timer]
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
App::I.clear();
|
||||
App::I.update(frame_timer);
|
||||
App::I.draw(frame_timer);
|
||||
SwapBuffers(hDC);
|
||||
});
|
||||
frame_timer = 0;
|
||||
@@ -1244,39 +1245,28 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
|
||||
BT_SetTerminate();
|
||||
break;
|
||||
case WM_CLOSE:
|
||||
if (App::I.request_close())
|
||||
{
|
||||
running = 0;
|
||||
ui_render_cv.notify_all();
|
||||
if (ui_renderer.joinable())
|
||||
ui_renderer.join();
|
||||
if (hmd_renderer.joinable())
|
||||
hmd_renderer.join();
|
||||
App::I.terminate();
|
||||
PostQuitMessage(0);
|
||||
render_running = false;
|
||||
if (render_thread.joinable())
|
||||
render_thread.join();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(task_mutex);
|
||||
tasklist.emplace_back([=] {
|
||||
if (App::I.request_close())
|
||||
{
|
||||
destroy_window();
|
||||
}
|
||||
});
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case WM_SIZE:
|
||||
{
|
||||
auto w = (float)LOWORD(lp);
|
||||
auto h = (float)HIWORD(lp);
|
||||
if (h != 0 && running == 1)
|
||||
{
|
||||
App::I.render_task([=]
|
||||
std::lock_guard<std::mutex> lock(task_mutex);
|
||||
tasklist.emplace_back([=]
|
||||
{
|
||||
App::I.resize(w, h);
|
||||
App::I.clear();
|
||||
App::I.redraw = true;
|
||||
App::I.update(0.f);
|
||||
SwapBuffers(hDC);
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user