16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 00:59:19 +02:00

add crashreporter

This commit is contained in:
milek7
2021-02-09 15:16:14 +01:00
parent 2376aa6fb0
commit 3d15cf3672
19 changed files with 463 additions and 81 deletions

View File

@@ -242,12 +242,14 @@ bool ui_layer::init(GLFWwindow *Window)
ImGui_ImplGlfw_InitForOpenGL(m_window, false);
#ifdef EU07_USEIMGUIIMPLOPENGL2
crashreport_add_info("imgui_ver", "gl2");
ImGui_ImplOpenGL2_Init();
#else
crashreport_add_info("imgui_ver", "gl3");
if (Global.gfx_usegles)
ImGui_ImplOpenGL3_Init("#version 300 es\nprecision highp float;");
else
ImGui_ImplOpenGL3_Init("#version 330 core");
ImGui_ImplOpenGL3_Init("#version 330 core");
#endif
return true;
@@ -335,16 +337,26 @@ void ui_layer::render()
render_();
gl::buffer::unbind(gl::buffer::ARRAY_BUFFER);
render_internal();
}
void ui_layer::render_internal()
{
ImGui::Render();
#ifdef EU07_USEIMGUIIMPLOPENGL2
ImGui_ImplOpenGL2_RenderDrawData(ImGui::GetDrawData());
ImGui_ImplOpenGL2_RenderDrawData(ImGui::GetDrawData());
#else
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
#endif
}
void ui_layer::begin_ui_frame()
{
begin_ui_frame_internal();
}
void ui_layer::begin_ui_frame_internal()
{
#ifdef EU07_USEIMGUIIMPLOPENGL2
ImGui_ImplOpenGL2_NewFrame();