Selaa lähdekoodia

Examples: GLFW+GL2/GL3: Added glPixelStorei() calls borrowed from SDL examples.

omar 7 vuotta sitten
vanhempi
commit
f5f3730b16

+ 1 - 0
examples/opengl2_example/imgui_impl_glfw_gl2.cpp

@@ -194,6 +194,7 @@ bool ImGui_ImplGlfwGL2_CreateDeviceObjects()
     glBindTexture(GL_TEXTURE_2D, g_FontTexture);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
 
     // Store our identifier

+ 1 - 0
examples/opengl3_example/imgui_impl_glfw_gl3.cpp

@@ -218,6 +218,7 @@ bool ImGui_ImplGlfwGL3_CreateFontsTexture()
     glBindTexture(GL_TEXTURE_2D, g_FontTexture);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
 
     // Store our identifier