The default wrap mode is REPEAT
As per spec, both for OpenGL and OpenGL ES. No wrap mode is applied unless setWrapMode() is called so the default values should be initialized to match OpenGL's default. Correct the copy-paste mistake in the warning messages. Change-Id: I094cc511dc7de4a214da61faadb1fc362270b2d4 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>bb10
parent
b7d7527720
commit
71e3ce7f0b
|
|
@ -120,7 +120,8 @@ QOpenGLTexturePrivate::QOpenGLTexturePrivate(QOpenGLTexture::Target textureTarge
|
|||
swizzleMask[2] = QOpenGLTexture::BlueValue;
|
||||
swizzleMask[3] = QOpenGLTexture::AlphaValue;
|
||||
|
||||
wrapModes[0] = wrapModes[1] = wrapModes[2] = QOpenGLTexture::ClampToEdge;
|
||||
wrapModes[0] = wrapModes[1] = wrapModes[2] = target == QOpenGLTexture::TargetRectangle
|
||||
? QOpenGLTexture::ClampToEdge : QOpenGLTexture::Repeat;
|
||||
}
|
||||
|
||||
QOpenGLTexturePrivate::~QOpenGLTexturePrivate()
|
||||
|
|
@ -215,7 +216,8 @@ void QOpenGLTexturePrivate::destroy()
|
|||
swizzleMask[2] = QOpenGLTexture::BlueValue;
|
||||
swizzleMask[3] = QOpenGLTexture::AlphaValue;
|
||||
|
||||
wrapModes[0] = wrapModes[1] = wrapModes[2] = QOpenGLTexture::ClampToEdge;
|
||||
wrapModes[0] = wrapModes[1] = wrapModes[2] = target == QOpenGLTexture::TargetRectangle
|
||||
? QOpenGLTexture::ClampToEdge : QOpenGLTexture::Repeat;
|
||||
}
|
||||
|
||||
void QOpenGLTexturePrivate::bind()
|
||||
|
|
@ -1393,7 +1395,7 @@ QOpenGLTexture::WrapMode QOpenGLTexturePrivate::wrapMode(QOpenGLTexture::Coordin
|
|||
|
||||
case QOpenGLTexture::DirectionT:
|
||||
case QOpenGLTexture::DirectionR:
|
||||
qWarning("QOpenGLTexture::setWrapMode() direction not valid for this texture target");
|
||||
qWarning("QOpenGLTexture::wrapMode() direction not valid for this texture target");
|
||||
return QOpenGLTexture::Repeat;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1413,7 +1415,7 @@ QOpenGLTexture::WrapMode QOpenGLTexturePrivate::wrapMode(QOpenGLTexture::Coordin
|
|||
return wrapModes[1];
|
||||
|
||||
case QOpenGLTexture::DirectionR:
|
||||
qWarning("QOpenGLTexture::setWrapMode() direction not valid for this texture target");
|
||||
qWarning("QOpenGLTexture::wrapMode() direction not valid for this texture target");
|
||||
return QOpenGLTexture::Repeat;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue