Commit 9afa2374 authored by Dirk Wilden's avatar Dirk Wilden

changed getUniform functions

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7416 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b65238af
......@@ -923,31 +923,64 @@ void ViewControlPlugin::setShader(int _id, QString _drawMode, QString _name ){
//-----------------------------------------------------------------------------
/// get information about available uniforms for a given shader
bool ViewControlPlugin::getUniformInfo(QString _shader, QStringList& _uniforms,
QStringList& _uniformTypes,
QStringList& _uniformsDefault,
QStringList& _uniformsMax,
QStringList& _uniformsMin ){
QStringList ViewControlPlugin::getUniforms(QString _shader){
for (uint i=0; i < shaderList_.size(); i++)
if ( shaderList_[i].name == _shader)
return shaderList_[i].uniforms;
return QStringList();
}
QString ViewControlPlugin::getUniformType(QString _shader, QString _uniform ){
for (uint i=0; i < shaderList_.size(); i++)
if ( shaderList_[i].name == _shader){
_uniforms = shaderList_[i].uniforms;
_uniformTypes = shaderList_[i].uniformTypes;
_uniformsDefault = shaderList_[i].uniformsDefault;
_uniformsMax = shaderList_[i].uniformsMax;
_uniformsMin = shaderList_[i].uniformsMin;
for (int u=0; u < shaderList_[i].uniforms.count(); u++)
if ( shaderList_[i].uniforms[u] == _uniform )
return shaderList_[i].uniformTypes[u];
}
return QString();
}
QString ViewControlPlugin::getUniformDefault(QString _shader, QString _uniform ){
for (uint i=0; i < shaderList_.size(); i++)
if ( shaderList_[i].name == _shader){
return true;
for (int u=0; u < shaderList_[i].uniforms.count(); u++)
if ( shaderList_[i].uniforms[u] == _uniform )
return shaderList_[i].uniformsDefault[u];
}
_uniforms = QStringList();
_uniformTypes = QStringList();
_uniformsDefault = QStringList();
_uniformsMax = QStringList();
_uniformsMin = QStringList();
return false;
return QString();
}
QString ViewControlPlugin::getUniformMin(QString _shader, QString _uniform ){
for (uint i=0; i < shaderList_.size(); i++)
if ( shaderList_[i].name == _shader){
for (int u=0; u < shaderList_[i].uniforms.count(); u++)
if ( shaderList_[i].uniforms[u] == _uniform )
return shaderList_[i].uniformsMin[u];
}
return QString();
}
QString ViewControlPlugin::getUniformMax(QString _shader, QString _uniform ){
for (uint i=0; i < shaderList_.size(); i++)
if ( shaderList_[i].name == _shader){
for (int u=0; u < shaderList_[i].uniforms.count(); u++)
if ( shaderList_[i].uniforms[u] == _uniform )
return shaderList_[i].uniformsMax[u];
}
return QString();
}
//-----------------------------------------------------------------------------
......
......@@ -200,13 +200,13 @@ class ViewControlPlugin : public QObject, BaseInterface , PickingInterface, Logg
void setShader(int _id, QString _drawMode, QString _name );
/// get information about available uniforms for a given shader
bool getUniformInfo(QString _shader, QStringList& _uniforms,
QStringList& _uniformTypes,
QStringList& _uniformsDefault,
QStringList& _uniformsMax,
QStringList& _uniformsMin );
QStringList getUniforms(QString _shader);
QString getUniformType(QString _shader, QString _uniform );
QString getUniformDefault(QString _shader, QString _uniform );
QString getUniformMin(QString _shader, QString _uniform );
QString getUniformMax(QString _shader, QString _uniform );
/// set the value of a uniform in a shader for a specific drawMode
void setUniform(int _objID, unsigned int _drawMode, QString _shader, QString _uniform, QString _value );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment