Added support for geometry shader attributes

This commit is contained in:
Robert Osfield 2008-08-15 17:18:10 +00:00
parent 7cd4641ece
commit 5400e570c7
2 changed files with 16 additions and 1 deletions

View File

@ -38,8 +38,9 @@
#define VERSION_0027 27
#define VERSION_0028 28
#define VERSION_0029 29
#define VERSION_0030 30
#define VERSION VERSION_0029
#define VERSION VERSION_0030
/* The BYTE_SEX tag is used to check the endian
of the IVE file being read in. The IVE format

View File

@ -29,6 +29,13 @@ void Program::write(DataOutputStream* out){
}
else
throw Exception("Program::write(): Could not cast this osg::Program to an osg::Object.");
if ( out->getVersion() >= VERSION_0030 )
{
out->writeInt(getParameter(GL_GEOMETRY_VERTICES_OUT_EXT));
out->writeInt(getParameter(GL_GEOMETRY_INPUT_TYPE_EXT));
out->writeInt(getParameter(GL_GEOMETRY_OUTPUT_TYPE_EXT));
}
const AttribBindingList& abl = getAttribBindingList();
out->writeUInt(abl.size());
@ -71,6 +78,13 @@ void Program::read(DataInputStream* in)
throw Exception("Program::read(): Expected Program identification.");
}
if ( in->getVersion() >= VERSION_0030 )
{
setParameter(GL_GEOMETRY_VERTICES_OUT_EXT, in->readInt());
setParameter(GL_GEOMETRY_INPUT_TYPE_EXT, in->readInt());
setParameter(GL_GEOMETRY_OUTPUT_TYPE_EXT, in->readInt());
}
// reading in shaders.
unsigned int size = in->readUInt();
for(unsigned int ai=0; ai<size; ++ai)