aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-19 02:27:56 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-19 02:27:56 +0100
commit25d8254ae709bbcc05bb6cde07859ab3040369ba (patch)
treef00337907ab064c2bf6e6b4c245624b1c4627210
parent320450fda5cdcfa542aec6687c2b02e401d729d1 (diff)
Colormap: texture update fixed.
-rw-r--r--colormap.cpp7
1 files changed, 5 insertions, 2 deletions
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;
}