mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 04:19:19 +02:00
imgui2 fix, relax GL context requirements for legacy mode
This commit is contained in:
@@ -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 <unistd.h>
|
||||
@@ -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);
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user