From 25d8254ae709bbcc05bb6cde07859ab3040369ba Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 19 Jan 2016 02:27:56 +0100 Subject: Colormap: texture update fixed. --- colormap.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'colormap.cpp') diff --git a/colormap.cpp b/colormap.cpp index 4d60021..cc57048 100644 --- a/colormap.cpp +++ b/colormap.cpp @@ -52,8 +52,11 @@ void ColormapTexture::bind() bool ColormapTexture::updateTexture() { - gl.glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_size.width(), m_size.height(), - GL_RGB, GL_FLOAT, m_cmap->data()); + m_size.setWidth(m_cmap->size() / 3); + + gl.glBindTexture(GL_TEXTURE_2D, m_texture); + gl.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_size.width(), m_size.height(), + 0, GL_RGB, GL_FLOAT, m_cmap->data()); return true; } -- cgit v1.2.3