16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 13:39:18 +02:00

Merge branch 'tmj-dev' into milek-dev

This commit is contained in:
milek7
2018-10-10 21:37:52 +02:00
37 changed files with 2199 additions and 1150 deletions

View File

@@ -15,7 +15,11 @@ http://mozilla.org/MPL/2.0/.
#include "Logs.h"
#include "imgui/imgui_impl_glfw.h"
#ifdef EU07_USEIMGUIIMPLOPENGL2
#include "imgui/imgui_impl_opengl2.h"
#else
#include "imgui/imgui_impl_opengl3.h"
#endif
#ifdef _WIN32
extern "C"
@@ -100,11 +104,16 @@ ui_layer::init( GLFWwindow *Window ) {
m_imguiio = &ImGui::GetIO();
m_imguiio->Fonts->AddFontFromFileTTF("DejaVuSansMono.ttf", 13.0f);
ImGui_ImplGlfw_InitForOpenGL(m_window);
ImGui_ImplOpenGL3_Init("#version 130");
ImGui::StyleColorsClassic();
ImGui_ImplGlfw_InitForOpenGL(m_window);
#ifdef EU07_USEIMGUIIMPLOPENGL2
ImGui_ImplOpenGL2_Init();
ImGui_ImplOpenGL2_NewFrame();
#else
ImGui_ImplOpenGL3_Init("#version 130");
ImGui_ImplOpenGL3_NewFrame();
#endif
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
@@ -115,7 +124,11 @@ void
ui_layer::shutdown() {
ImGui::EndFrame();
#ifdef EU07_USEIMGUIIMPLOPENGL2
ImGui_ImplOpenGL2_Shutdown();
#else
ImGui_ImplOpenGL3_Shutdown();
#endif
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
}
@@ -183,9 +196,14 @@ ui_layer::render() {
render_();
ImGui::Render();
#ifdef EU07_USEIMGUIIMPLOPENGL2
ImGui_ImplOpenGL2_RenderDrawData(ImGui::GetDrawData());
ImGui_ImplOpenGL2_NewFrame();
#else
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
ImGui_ImplOpenGL3_NewFrame();
#endif
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
}