Put in place the class to implement GLSL support in .ive

This commit is contained in:
Robert Osfield
2005-05-10 20:20:20 +00:00
parent d681d47c72
commit d9c50ee7c4
15 changed files with 349 additions and 9 deletions

View File

@@ -0,0 +1,57 @@
/**********************************************************************
*
* FILE: Program.cpp
*
* DESCRIPTION: Read/Write osg::Program in binary format to disk.
*
* CREATED BY: Auto generated by iveGenerated
* and later modified by Rune Schmidt Jensen.
*
* HISTORY: Created 20.3.2003
*
* Copyright 2003 VR-C
**********************************************************************/
#include "Exception.h"
#include "Program.h"
#include "Object.h"
using namespace ive;
void Program::write(DataOutputStream* out){
// Write Program's identification.
out->writeInt(IVEPROGRAM);
// If the osg class is inherited by any other class we should also write this to file.
osg::Object* obj = dynamic_cast<osg::Object*>(this);
if(obj)
{
((ive::Object*)(obj))->write(out);
}
else
throw Exception("Program::write(): Could not cast this osg::Program to an osg::Object.");
}
void Program::read(DataInputStream* in)
{
// Read Program's identification.
int id = in->peekInt();
if(id == IVEPROGRAM)
{
// Read Program's identification.
id = in->readInt();
// If the osg class is inherited by any other class we should also read this from file.
osg::Object* obj = dynamic_cast<osg::Object*>(this);
if(obj)
{
((ive::Object*)(obj))->read(in);
}
else
throw Exception("Program::read(): Could not cast this osg::Program to an osg::Object.");
}
else
{
throw Exception("Program::read(): Expected Program identification.");
}
}