The current implementation of readImageFromCurrentTexture doesn't consider the texture rectangle mode.
Find attached a version of the file that corrects this issue
This commit is contained in:
parent
4d2221bdb3
commit
42af2d3597
@ -1066,10 +1066,11 @@ void Image::readImageFromCurrentTexture(unsigned int contextID, bool copyMipMaps
|
||||
|
||||
const osg::GLExtensions* extensions = osg::GLExtensions::Get(contextID,true);
|
||||
|
||||
GLboolean binding1D = GL_FALSE, binding2D = GL_FALSE, binding3D = GL_FALSE, binding2DArray = GL_FALSE, bindingCubeMap = GL_FALSE;
|
||||
GLboolean binding1D = GL_FALSE, binding2D = GL_FALSE, bindingRect = GL_FALSE, binding3D = GL_FALSE, binding2DArray = GL_FALSE, bindingCubeMap = GL_FALSE;
|
||||
|
||||
glGetBooleanv(GL_TEXTURE_BINDING_1D, &binding1D);
|
||||
glGetBooleanv(GL_TEXTURE_BINDING_2D, &binding2D);
|
||||
glGetBooleanv(GL_TEXTURE_BINDING_RECTANGLE, &bindingRect);
|
||||
glGetBooleanv(GL_TEXTURE_BINDING_3D, &binding3D);
|
||||
glGetBooleanv(GL_TEXTURE_BINDING_CUBE_MAP, &bindingCubeMap);
|
||||
|
||||
@ -1078,7 +1079,7 @@ void Image::readImageFromCurrentTexture(unsigned int contextID, bool copyMipMaps
|
||||
glGetBooleanv(GL_TEXTURE_BINDING_2D_ARRAY_EXT, &binding2DArray);
|
||||
}
|
||||
|
||||
GLenum textureMode = binding1D ? GL_TEXTURE_1D : binding2D ? GL_TEXTURE_2D : binding3D ? GL_TEXTURE_3D : binding2DArray ? GL_TEXTURE_2D_ARRAY_EXT : 0;
|
||||
GLenum textureMode = binding1D ? GL_TEXTURE_1D : binding2D ? GL_TEXTURE_2D : bindingRect ? GL_TEXTURE_RECTANGLE : binding3D ? GL_TEXTURE_3D : binding2DArray ? GL_TEXTURE_2D_ARRAY_EXT : 0;
|
||||
if (bindingCubeMap)
|
||||
{
|
||||
switch (face)
|
||||
|
Loading…
Reference in New Issue
Block a user