From 3aac7a0f18a33cc8acf76ac9e25c0cd320105174 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Sun, 17 Aug 2014 15:23:10 +0100 Subject: Mark backend render classes as private and fix compilation Change-Id: I1afb8408e03d4b5405e8ee82d1a3b6b4364d3f5d Reviewed-by: Sean Harmer --- src/render/io/gltfparser.cpp | 87 ++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 43 deletions(-) (limited to 'src/render/io/gltfparser.cpp') diff --git a/src/render/io/gltfparser.cpp b/src/render/io/gltfparser.cpp index 76c7ba27d..60be17f1c 100644 --- a/src/render/io/gltfparser.cpp +++ b/src/render/io/gltfparser.cpp @@ -71,8 +71,8 @@ #include // need to move these to somewhere common? -#include -#include +#include +#include QT_BEGIN_NAMESPACE @@ -869,56 +869,57 @@ void GLTFParser::processJSONTechnique( QString id, QJsonObject jsonObj ) // pass->addUniformBinding(paramDict[pname], uniformName); } // of program-instance attributes - QJsonObject states = po.value(KEY_STATES).toObject(); - Render::RenderStateSet* ss = new Render::RenderStateSet; + // TODO: Use public state api only here +// QJsonObject states = po.value(KEY_STATES).toObject(); +// Render::RenderStateSet* ss = new Render::RenderStateSet; - Q_FOREACH (QString stateName, states.keys()) { - Render::RenderState* s= buildState(stateName.toUtf8(), states.value(stateName)); - if (!s) - continue; +// Q_FOREACH (QString stateName, states.keys()) { +// Render::RenderState* s= buildState(stateName.toUtf8(), states.value(stateName)); +// if (!s) +// continue; - ss->addState(s); - } // of program-instance attributes +// ss->addState(s); +// } // of program-instance attributes - pass->setStateSet(ss); +// pass->setStateSet(ss); t->addPass(pass); } // of passes iteration m_techniques[id] = t; } -Render::RenderState* GLTFParser::buildState(const QByteArray& nm, QJsonValue v) -{ - if (nm == "blendEnable") { - return NULL; // will see a blendEquation spec too - } - - if (nm == "blendFunc") { - QJsonObject obj = v.toObject(); - GLenum srcF = static_cast(obj.value(QStringLiteral("sfactor")).toInt()); - GLenum dstF = static_cast(obj.value(QStringLiteral("dfactor")).toInt()); - return Render::BlendState::getOrCreate(srcF, dstF); - } - - if (nm == "blendEquation") { - return Render::BlendEquation::getOrCreate(static_cast(v.toInt())); - } - - if (nm == "cullFaceEnable" && v.toInt()) { - return Render::CullFace::getOrCreate(GL_BACK); - } - - if (nm == "depthTestEnable" && v.toInt()) { - return Render::DepthTest::getOrCreate(GL_LESS); - } - - if (nm == "depthMask") { - return Render::DepthMask::getOrCreate(v.toInt() ? GL_TRUE : GL_FALSE); - } - - qCWarning(Render::Io) << Q_FUNC_INFO << "unsupported gltf state:" << nm; - return NULL; -} +//Render::RenderState* GLTFParser::buildState(const QByteArray& nm, QJsonValue v) +//{ +// if (nm == "blendEnable") { +// return NULL; // will see a blendEquation spec too +// } + +// if (nm == "blendFunc") { +// QJsonObject obj = v.toObject(); +// GLenum srcF = static_cast(obj.value(QStringLiteral("sfactor")).toInt()); +// GLenum dstF = static_cast(obj.value(QStringLiteral("dfactor")).toInt()); +// return Render::BlendState::getOrCreate(srcF, dstF); +// } + +// if (nm == "blendEquation") { +// return Render::BlendEquation::getOrCreate(static_cast(v.toInt())); +// } + +// if (nm == "cullFaceEnable" && v.toInt()) { +// return Render::CullFace::getOrCreate(GL_BACK); +// } + +// if (nm == "depthTestEnable" && v.toInt()) { +// return Render::DepthTest::getOrCreate(GL_LESS); +// } + +// if (nm == "depthMask") { +// return Render::DepthMask::getOrCreate(v.toInt() ? GL_TRUE : GL_FALSE); +// } + +// qCWarning(Render::Io) << Q_FUNC_INFO << "unsupported gltf state:" << nm; +// return NULL; +//} QFile *GLTFParser::resolveLocalData(QString path) { -- cgit v1.2.3