From Stephan Huber, attached you'll find a compile fix for the new introduced rowlength-feature on IOS/OpenGL ES builds
This commit is contained in:
@@ -217,7 +217,7 @@ class OSG_EXPORT Image : public BufferData
|
||||
/** Depth of image. */
|
||||
inline int r() const { return _r; }
|
||||
|
||||
void setRowLength(int length) { _rowLength = length; }
|
||||
void setRowLength(int length);
|
||||
inline int getRowLength() const { return _rowLength; }
|
||||
|
||||
void setInternalTextureFormat(GLint internalFormat);
|
||||
|
||||
@@ -795,6 +795,17 @@ unsigned int Image::getTotalSizeInBytesIncludingMipmaps() const
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
void Image::setRowLength(int length)
|
||||
{
|
||||
_rowLength = length;
|
||||
#if defined(OSG_GLES1_FEATURES) || defined(OSG_GLES2_FEATURES)
|
||||
if (length > 0)
|
||||
{
|
||||
OSG_WARN << "Image::setRowLength is not supported on this platform, ignoring" << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void Image::setInternalTextureFormat(GLint internalFormat)
|
||||
{
|
||||
|
||||
@@ -1922,9 +1922,9 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
|
||||
{
|
||||
pbo = 0;
|
||||
}
|
||||
|
||||
#if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,rowLength);
|
||||
|
||||
#endif
|
||||
if( !mipmappingRequired || useHardwareMipMapGeneration)
|
||||
{
|
||||
|
||||
@@ -2177,9 +2177,9 @@ void Texture::applyTexImage2D_subload(State& state, GLenum target, const Image*
|
||||
{
|
||||
pbo = 0;
|
||||
}
|
||||
|
||||
#if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,rowLength);
|
||||
|
||||
#endif
|
||||
if( !mipmappingRequired || useHardwareMipMapGeneration)
|
||||
{
|
||||
|
||||
|
||||
@@ -455,7 +455,9 @@ void Texture2DArray::applyTexImage2DArray_subload(State& state, Image* image, GL
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT,image->getPacking());
|
||||
#if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,image->getRowLength());
|
||||
#endif
|
||||
|
||||
bool useHardwareMipmapGeneration =
|
||||
!image->isMipmap() && _useHardwareMipMapGeneration && texExtensions->isGenerateMipMapSupported();
|
||||
|
||||
@@ -380,7 +380,9 @@ void Texture3D::applyTexImage3D(GLenum target, Image* image, State& state, GLsiz
|
||||
image->ensureValidSizeForTexturing(extensions->maxTexture3DSize());
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT,image->getPacking());
|
||||
#if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,image->getRowLength());
|
||||
#endif
|
||||
|
||||
bool useHardwareMipMapGeneration = !image->isMipmap() && _useHardwareMipMapGeneration && texExtensions->isGenerateMipMapSupported();
|
||||
|
||||
|
||||
@@ -312,7 +312,9 @@ void TextureRectangle::applyTexImage_load(GLenum target, Image* image, State& st
|
||||
computeInternalFormat();
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, image->getPacking());
|
||||
#if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,image->getRowLength());
|
||||
#endif
|
||||
|
||||
bool useClientStorage = extensions->isClientStorageSupported() && getClientStorageHint();
|
||||
if (useClientStorage)
|
||||
@@ -412,7 +414,9 @@ void TextureRectangle::applyTexImage_subload(GLenum target, Image* image, State&
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,rowLength);
|
||||
#endif
|
||||
|
||||
if(isCompressedInternalFormat(_internalFormat) && extensions->isCompressedTexSubImage2DSupported())
|
||||
{
|
||||
|
||||
@@ -474,7 +474,10 @@ void Glyph::subload() const
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT,getPacking());
|
||||
|
||||
#if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH,getRowLength());
|
||||
#endif
|
||||
|
||||
glTexSubImage2D(GL_TEXTURE_2D,0,
|
||||
_texturePosX,_texturePosY,
|
||||
|
||||
Reference in New Issue
Block a user