diff --git a/application.cpp b/application.cpp index e24dcda1..8e1bfc42 100644 --- a/application.cpp +++ b/application.cpp @@ -30,11 +30,13 @@ http://mozilla.org/MPL/2.0/. #include "dictionary.h" #include "version_info.h" +#ifdef _WIN32 #pragma comment (lib, "dsound.lib") #pragma comment (lib, "winmm.lib") #pragma comment (lib, "setupapi.lib") #pragma comment (lib, "dbghelp.lib") #pragma comment (lib, "version.lib") +#endif #ifdef __unix__ #include @@ -751,9 +753,13 @@ eu07_application::init_glfw() { } } else { Global.gfx_shadergamma = false; - glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE ); + glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE ); + glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 0 ); +#ifndef EU07_USEIMGUIIMPLOPENGL2 glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 3 ); - glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 3 ); +#else + glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 2 ); +#endif } glfwWindowHint(GLFW_SRGB_CAPABLE, !Global.gfx_shadergamma); diff --git a/imgui/imgui_impl_opengl2.cpp b/imgui/imgui_impl_opengl2.cpp index 8bb303ac..90521b1b 100644 --- a/imgui/imgui_impl_opengl2.cpp +++ b/imgui/imgui_impl_opengl2.cpp @@ -124,6 +124,8 @@ void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data) const ImDrawList* cmd_list = draw_data->CmdLists[n]; const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data; const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data; + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); glVertexPointer(2, GL_FLOAT, sizeof(ImDrawVert), (const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, pos))); glTexCoordPointer(2, GL_FLOAT, sizeof(ImDrawVert), (const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, uv))); glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(ImDrawVert), (const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, col)));