Commit eb4219d5 authored by Dirk Wilden's avatar Dirk Wilden
Browse files

changed getUniform functions

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7416 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ce253eb4
...@@ -923,31 +923,64 @@ void ViewControlPlugin::setShader(int _id, QString _drawMode, QString _name ){ ...@@ -923,31 +923,64 @@ void ViewControlPlugin::setShader(int _id, QString _drawMode, QString _name ){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/// get information about available uniforms for a given shader QStringList ViewControlPlugin::getUniforms(QString _shader){
bool ViewControlPlugin::getUniformInfo(QString _shader, QStringList& _uniforms, for (uint i=0; i < shaderList_.size(); i++)
QStringList& _uniformTypes, if ( shaderList_[i].name == _shader)
QStringList& _uniformsDefault, return shaderList_[i].uniforms;
QStringList& _uniformsMax,
QStringList& _uniformsMin ){ return QStringList();
}
QString ViewControlPlugin::getUniformType(QString _shader, QString _uniform ){
for (uint i=0; i < shaderList_.size(); i++) for (uint i=0; i < shaderList_.size(); i++)
if ( shaderList_[i].name == _shader){ if ( shaderList_[i].name == _shader){
_uniforms = shaderList_[i].uniforms; for (int u=0; u < shaderList_[i].uniforms.count(); u++)
_uniformTypes = shaderList_[i].uniformTypes; if ( shaderList_[i].uniforms[u] == _uniform )
_uniformsDefault = shaderList_[i].uniformsDefault; return shaderList_[i].uniformTypes[u];
_uniformsMax = shaderList_[i].uniformsMax; }
_uniformsMin = shaderList_[i].uniformsMin;
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(); return QString();
_uniformTypes = QStringList(); }
_uniformsDefault = QStringList();
_uniformsMax = QStringList(); QString ViewControlPlugin::getUniformMin(QString _shader, QString _uniform ){
_uniformsMin = QStringList();
return false; 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 ...@@ -200,13 +200,13 @@ class ViewControlPlugin : public QObject, BaseInterface , PickingInterface, Logg
void setShader(int _id, QString _drawMode, QString _name ); void setShader(int _id, QString _drawMode, QString _name );
/// get information about available uniforms for a given shader /// get information about available uniforms for a given shader
bool getUniformInfo(QString _shader, QStringList& _uniforms, QStringList getUniforms(QString _shader);
QStringList& _uniformTypes,
QStringList& _uniformsDefault, QString getUniformType(QString _shader, QString _uniform );
QStringList& _uniformsMax, QString getUniformDefault(QString _shader, QString _uniform );
QStringList& _uniformsMin ); 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 /// 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 ); void setUniform(int _objID, unsigned int _drawMode, QString _shader, QString _uniform, QString _value );
......
Supports Markdown
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