mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 12:49:18 +02:00
we do not use separate sampler binding, do not save them in imgui3 (also fixes gl3.0 context)
This commit is contained in:
@@ -159,9 +159,6 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
|
|||||||
glUseProgram(g_ShaderHandle);
|
glUseProgram(g_ShaderHandle);
|
||||||
glUniform1i(g_AttribLocationTex, 0);
|
glUniform1i(g_AttribLocationTex, 0);
|
||||||
glUniformMatrix4fv(g_AttribLocationProjMtx, 1, GL_FALSE, &ortho_projection[0][0]);
|
glUniformMatrix4fv(g_AttribLocationProjMtx, 1, GL_FALSE, &ortho_projection[0][0]);
|
||||||
#ifdef GL_SAMPLER_BINDING
|
|
||||||
glBindSampler(0, 0); // We use combined texture/sampler state. Applications using GL 3.3 may set that otherwise.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
(void)vertex_array_object;
|
(void)vertex_array_object;
|
||||||
#ifndef IMGUI_IMPL_OPENGL_ES2
|
#ifndef IMGUI_IMPL_OPENGL_ES2
|
||||||
@@ -195,9 +192,6 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
GLint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, &last_program);
|
GLint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, &last_program);
|
||||||
GLint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
|
GLint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
|
||||||
#ifdef GL_SAMPLER_BINDING
|
|
||||||
GLint last_sampler; glGetIntegerv(GL_SAMPLER_BINDING, &last_sampler);
|
|
||||||
#endif
|
|
||||||
GLint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer);
|
GLint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer);
|
||||||
#ifndef IMGUI_IMPL_OPENGL_ES2
|
#ifndef IMGUI_IMPL_OPENGL_ES2
|
||||||
GLint last_vertex_array_object; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array_object);
|
GLint last_vertex_array_object; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array_object);
|
||||||
@@ -297,9 +291,6 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
// Restore modified GL state
|
// Restore modified GL state
|
||||||
glUseProgram(last_program);
|
glUseProgram(last_program);
|
||||||
glBindTexture(GL_TEXTURE_2D, last_texture);
|
glBindTexture(GL_TEXTURE_2D, last_texture);
|
||||||
#ifdef GL_SAMPLER_BINDING
|
|
||||||
glBindSampler(0, last_sampler);
|
|
||||||
#endif
|
|
||||||
glActiveTexture(last_active_texture);
|
glActiveTexture(last_active_texture);
|
||||||
#ifndef IMGUI_IMPL_OPENGL_ES2
|
#ifndef IMGUI_IMPL_OPENGL_ES2
|
||||||
glBindVertexArray(last_vertex_array_object);
|
glBindVertexArray(last_vertex_array_object);
|
||||||
|
|||||||
Reference in New Issue
Block a user