Teaks to API to make it easier to generate wrappers automatically
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include "osgDB/Input"
|
||||
#include "osgDB/Output"
|
||||
|
||||
#include "Matrix.h"
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgDB;
|
||||
using namespace std;
|
||||
@@ -45,6 +47,19 @@ bool VertexProgram_readLocalData(Object& obj, Input& fr)
|
||||
vertexProgram.setProgramLocalParameter(index, vec);
|
||||
}
|
||||
|
||||
if (fr[0].matchWord("Matrix"))
|
||||
{
|
||||
int index;
|
||||
fr[1].getInt(index);
|
||||
fr += 2;
|
||||
osg::Matrix matrix;
|
||||
if (readMatrix(matrix,fr))
|
||||
{
|
||||
vertexProgram.setMatrix(index, matrix);
|
||||
}
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
if (fr.matchSequence("code {")) {
|
||||
std::string code;
|
||||
fr += 2;
|
||||
@@ -88,13 +103,21 @@ bool VertexProgram_writeLocalData(const Object& obj,Output& fw)
|
||||
{
|
||||
const VertexProgram& vertexProgram = static_cast<const VertexProgram&>(obj);
|
||||
|
||||
const VertexProgram::LocalParamList& lpl = vertexProgram.getLocalParamList();
|
||||
const VertexProgram::LocalParamList& lpl = vertexProgram.getLocalParameters();
|
||||
VertexProgram::LocalParamList::const_iterator i;
|
||||
for(i=lpl.begin(); i!=lpl.end(); i++)
|
||||
{
|
||||
fw.indent() << "ProgramLocalParameter " << (*i).first << " " << (*i).second << std::endl;
|
||||
}
|
||||
|
||||
const VertexProgram::MatrixList& mpl = vertexProgram.getMatrices();
|
||||
VertexProgram::MatrixList::const_iterator mi;
|
||||
for(mi=mpl.begin(); mi!=mpl.end(); mi++)
|
||||
{
|
||||
fw.indent() << "Matrix " << (*mi).first << " ";
|
||||
writeMatrix((*mi).second,fw);
|
||||
}
|
||||
|
||||
|
||||
std::vector<std::string> lines;
|
||||
std::istringstream iss(vertexProgram.getVertexProgram());
|
||||
|
||||
Reference in New Issue
Block a user