mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-05-19 07:55:42 -04:00
ImGui: Fix incorrect buffer binding/crash in GLES2
This commit is contained in:
parent
8cafe856f0
commit
0d473e8681
@ -187,9 +187,13 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
|
|||||||
if (!g_IsGLES2)
|
if (!g_IsGLES2)
|
||||||
{
|
{
|
||||||
glBindVertexArray(g_VaoHandle);
|
glBindVertexArray(g_VaoHandle);
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ElementsHandle);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ElementsHandle);
|
||||||
glEnableVertexAttribArray(g_AttribLocationVtxPos);
|
glEnableVertexAttribArray(g_AttribLocationVtxPos);
|
||||||
glEnableVertexAttribArray(g_AttribLocationVtxUV);
|
glEnableVertexAttribArray(g_AttribLocationVtxUV);
|
||||||
glEnableVertexAttribArray(g_AttribLocationVtxColor);
|
glEnableVertexAttribArray(g_AttribLocationVtxColor);
|
||||||
@ -200,9 +204,6 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
|
|||||||
glVertexAttribPointer(g_AttribLocationVtxColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert),
|
glVertexAttribPointer(g_AttribLocationVtxColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert),
|
||||||
(GLvoid*)IM_OFFSETOF(ImDrawVert, col));
|
(GLvoid*)IM_OFFSETOF(ImDrawVert, col));
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle);
|
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ElementsHandle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenGL3 Render function.
|
// OpenGL3 Render function.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user