From 5400e570c77ef4df6d70da76631f4c316acc5971 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 15 Aug 2008 17:18:10 +0000 Subject: [PATCH] Added support for geometry shader attributes --- src/osgPlugins/ive/IveVersion.h | 3 ++- src/osgPlugins/ive/Program.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/ive/IveVersion.h b/src/osgPlugins/ive/IveVersion.h index dbcf6b321..d643d5164 100644 --- a/src/osgPlugins/ive/IveVersion.h +++ b/src/osgPlugins/ive/IveVersion.h @@ -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 diff --git a/src/osgPlugins/ive/Program.cpp b/src/osgPlugins/ive/Program.cpp index bb60e81de..7357f79ff 100644 --- a/src/osgPlugins/ive/Program.cpp +++ b/src/osgPlugins/ive/Program.cpp @@ -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