diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-06-23 09:44:26 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-06-27 20:51:27 +0200 |
commit | fc8b706c1915777c1bae58d807a029ed1c26ea35 (patch) | |
tree | 51fee5791a32de2aa528d820ab39b94e53dffd09 /src/render/io/gltfparser.cpp | |
parent | f0c02bcade659e20b0d5eb6c3c36e66b4bfc6a7d (diff) |
Texture updated
Added Q_PROPERTY to be able to set all values from QML.
Couldn't register QOpenGLTexture enums directly as QOpenGLTexture is not a
QObject so enums values where copied to Texture. A static_cast allows to
convert directly a Texture enum to a QOpenGLTexture enum.
Corrected Quick3DTexture and registered it as an extended type.
Change-Id: I1a99a2dd549722cd647cc53f60e720e0c4039df9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/io/gltfparser.cpp')
-rw-r--r-- | src/render/io/gltfparser.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/render/io/gltfparser.cpp b/src/render/io/gltfparser.cpp index 0728ff05e..6e493e544 100644 --- a/src/render/io/gltfparser.cpp +++ b/src/render/io/gltfparser.cpp @@ -754,8 +754,8 @@ void GLTFParser::processJSONTexture( QString id, QJsonObject jsonObj) //int pixelFormat = jsonObj.value(KEY_FORMAT).toInt(); //int internalFormat = jsonObj.value(KEY_INTERNAL_FORMAT).toInt(); - tex->setTarget(static_cast<QOpenGLTexture::Target>(target)); - tex->setInternalFormat(QOpenGLTexture::RGBA8_UNorm /* static_cast<QOpenGLTexture::TextureFormat>(internalFormat)*/); + tex->setTarget(static_cast<Texture::Target>(target)); + tex->setInternalFormat(Texture::RGBA8_UNorm /* static_cast<QOpenGLTexture::TextureFormat>(internalFormat)*/); QString samplerId = jsonObj.value(KEY_SAMPLER).toString(); QString source = jsonObj.value(KEY_SOURCE).toString(); @@ -774,11 +774,11 @@ void GLTFParser::processJSONTexture( QString id, QJsonObject jsonObj) QJsonObject sampler = samplersDict.value(samplerId).toObject(); - tex->setWrapMode(static_cast<QOpenGLTexture::WrapMode>(sampler.value(KEY_WRAP_S).toInt())); + tex->setWrapMode(static_cast<Texture::WrapMode>(sampler.value(KEY_WRAP_S).toInt())); // tex->setWrapMode(sampler.value("wrapT").toInt()); - tex->setMinificationFilter(static_cast<QOpenGLTexture::Filter>(sampler.value(KEY_MIN_FILTER).toInt())); - tex->setMagnificationFilter(static_cast<QOpenGLTexture::Filter>(sampler.value(KEY_MAG_FILTER).toInt())); + tex->setMinificationFilter(static_cast<Texture::Filter>(sampler.value(KEY_MIN_FILTER).toInt())); + tex->setMagnificationFilter(static_cast<Texture::Filter>(sampler.value(KEY_MAG_FILTER).toInt())); m_textures[id] = tex; } |