From 49aa3668da58a793e434807b8e2d167824661225 Mon Sep 17 00:00:00 2001 From: Steven Lovegrove Date: Tue, 23 Aug 2016 09:48:48 -0700 Subject: [PATCH] Revert "Use glTexImage2D rather than glTexSubImage2D when uploading a full texture" This was causing some code to break with GL_INVALID_OPERATION under some conditions. See https://www.opengl.org/wiki/Common_Mistakes#Updating_a_texture This reverts commit 74becf77a9f86b3176250c32a5cf385faedb4909. --- include/pangolin/gl/gl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pangolin/gl/gl.hpp b/include/pangolin/gl/gl.hpp index eec13e15c..93afbdf3b 100644 --- a/include/pangolin/gl/gl.hpp +++ b/include/pangolin/gl/gl.hpp @@ -194,7 +194,7 @@ inline void GlTexture::Upload( GLenum data_format, GLenum data_type ) { Bind(); - glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, data_format, data_type, data); + glTexSubImage2D(GL_TEXTURE_2D,0,0,0,width,height,data_format,data_type,data); CheckGlDieOnError(); }