From Ferdi Smit, "Image.cpp didn't handle the integer data types correctly in the function:
unsigned int Image::computeNumComponents(GLenum pixelFormat)
so I added these types to the switch statement:
case(GL_RED_INTEGER_EXT): return 1;
case(GL_GREEN_INTEGER_EXT): return 1;
case(GL_BLUE_INTEGER_EXT): return 1;
case(GL_ALPHA_INTEGER_EXT): return 1;
case(GL_RGB_INTEGER_EXT): return 3;
case(GL_RGBA_INTEGER_EXT): return 4;
case(GL_BGR_INTEGER_EXT): return 3;
case(GL_BGRA_INTEGER_EXT): return 4;
case(GL_LUMINANCE_INTEGER_EXT): return 1;
case(GL_LUMINANCE_ALPHA_INTEGER_EXT): return 2;
That's all... now it computes the number of components and, thus, the image size
correctly."
This commit is contained in:
@@ -205,7 +205,7 @@ GLenum Image::computePixelFormat(GLenum format)
|
||||
case(GL_LUMINANCE_ALPHA8UI_EXT):
|
||||
case(GL_LUMINANCE_ALPHA16UI_EXT):
|
||||
case(GL_LUMINANCE_ALPHA32UI_EXT):
|
||||
return GL_LUMINANCE_ALPHA_INTEGER_EXT;;
|
||||
return GL_LUMINANCE_ALPHA_INTEGER_EXT;
|
||||
case(GL_RGB32I_EXT):
|
||||
case(GL_RGB16I_EXT):
|
||||
case(GL_RGB8I_EXT):
|
||||
@@ -364,6 +364,17 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat)
|
||||
case(GL_DSDT_NV): return 2;
|
||||
case(GL_DSDT_MAG_NV): return 3;
|
||||
case(GL_DSDT_MAG_VIB_NV): return 4;
|
||||
case(GL_RED_INTEGER_EXT): return 1;
|
||||
case(GL_GREEN_INTEGER_EXT): return 1;
|
||||
case(GL_BLUE_INTEGER_EXT): return 1;
|
||||
case(GL_ALPHA_INTEGER_EXT): return 1;
|
||||
case(GL_RGB_INTEGER_EXT): return 3;
|
||||
case(GL_RGBA_INTEGER_EXT): return 4;
|
||||
case(GL_BGR_INTEGER_EXT): return 3;
|
||||
case(GL_BGRA_INTEGER_EXT): return 4;
|
||||
case(GL_LUMINANCE_INTEGER_EXT): return 1;
|
||||
case(GL_LUMINANCE_ALPHA_INTEGER_EXT): return 2;
|
||||
|
||||
default:
|
||||
{
|
||||
notify(WARN)<<"error pixelFormat = "<<std::hex<<pixelFormat<<std::endl;
|
||||
|
||||
Reference in New Issue
Block a user