Teaks to API to make it easier to generate wrappers automatically

This commit is contained in:
Robert Osfield
2004-12-13 01:07:24 +00:00
parent 1c4f615d1a
commit 66396e9452
10 changed files with 117 additions and 28 deletions

View File

@@ -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());