mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Fix segfault when using more than 32 colors in colormap
This commit is contained in:
parent
184a6ba4c5
commit
05c01ee884
@ -497,7 +497,8 @@ namespace netgen
|
||||
{
|
||||
ntexcols = ncols;
|
||||
|
||||
GLubyte colortexture[4*32];
|
||||
ArrayMem<GLubyte, 4*32> colortexture;
|
||||
colortexture.SetSize(4*ncols);
|
||||
|
||||
const double colp[][3] =
|
||||
{
|
||||
@ -532,8 +533,8 @@ namespace netgen
|
||||
|
||||
// glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glTexImage1D (GL_TEXTURE_1D, 0, 4, ncols, 0, GL_RGBA, GL_UNSIGNED_BYTE, colortexture);
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, 4, ncols, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, colortexture);
|
||||
glTexImage1D (GL_TEXTURE_1D, 0, 4, ncols, 0, GL_RGBA, GL_UNSIGNED_BYTE, colortexture.Data());
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, 4, ncols, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, colortexture.Data());
|
||||
|
||||
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, typ); // DECAL or MODULATE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user