Change Shader::getPCS(..) from protected to public scope to enable isCompiled() method to be accessible in applications.

Updated wrappers
This commit is contained in:
Robert Osfield
2010-03-05 11:30:50 +00:00
parent 4b4dd94b5d
commit 5383297cbe
3 changed files with 56 additions and 60 deletions

View File

@@ -184,7 +184,7 @@ class OSG_EXPORT Shader : public osg::Object
static Shader::Type getTypeId( const std::string& tname ); static Shader::Type getTypeId( const std::string& tname );
protected: public:
/** PerContextShader (PCS) is an OSG-internal encapsulation of glShader per-GL context. */ /** PerContextShader (PCS) is an OSG-internal encapsulation of glShader per-GL context. */
class PerContextShader : public osg::Referenced class PerContextShader : public osg::Referenced
{ {
@@ -227,10 +227,11 @@ class OSG_EXPORT Shader : public osg::Object
PerContextShader& operator=(const PerContextShader&); // disallowed PerContextShader& operator=(const PerContextShader&); // disallowed
}; };
PerContextShader* getPCS(unsigned int contextID) const;
protected: /*methods*/ protected: /*methods*/
virtual ~Shader(); virtual ~Shader();
PerContextShader* getPCS(unsigned int contextID) const;
friend class osg::Program; friend class osg::Program;
bool addProgramRef( osg::Program* program ); bool addProgramRef( osg::Program* program );

View File

@@ -171,6 +171,7 @@ BEGIN_OBJECT_REFLECTOR(osg::Shader)
__bool__getGlShaderInfoLog__unsigned_int__std_string_R1, __bool__getGlShaderInfoLog__unsigned_int__std_string_R1,
"Query InfoLog from a glShader. ", "Query InfoLog from a glShader. ",
""); "");
I_StaticMethod2(osg::Shader *, readShaderFile, IN, osg::Shader::Type, type, IN, const std::string &, fileName, I_StaticMethod2(osg::Shader *, readShaderFile, IN, osg::Shader::Type, type, IN, const std::string &, fileName,
__Shader_P1__readShaderFile__Type__C5_std_string_R1_S, __Shader_P1__readShaderFile__Type__C5_std_string_R1_S,
"Read shader source from file and then constructor shader of specified type. ", "Read shader source from file and then constructor shader of specified type. ",
@@ -191,7 +192,6 @@ BEGIN_OBJECT_REFLECTOR(osg::Shader)
__Shader_Type__getTypeId__C5_std_string_R1_S, __Shader_Type__getTypeId__C5_std_string_R1_S,
"", "",
""); "");
I_ProtectedMethod1(bool, addProgramRef, IN, osg::Program *, program, I_ProtectedMethod1(bool, addProgramRef, IN, osg::Program *, program,
Properties::NON_VIRTUAL, Properties::NON_VIRTUAL,
Properties::NON_CONST, Properties::NON_CONST,
@@ -221,6 +221,58 @@ BEGIN_OBJECT_REFLECTOR(osg::Shader)
0); 0);
END_REFLECTOR END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osg::Shader::PerContextShader)
I_DeclaringFile("osg/Shader");
I_BaseType(osg::Referenced);
I_Constructor2(IN, const osg::Shader *, shader, IN, unsigned int, contextID,
____PerContextShader__C5_Shader_P1__unsigned_int,
"",
"");
I_Method0(GLuint, getHandle,
Properties::NON_VIRTUAL,
__GLuint__getHandle,
"",
"");
I_Method0(void, requestCompile,
Properties::NON_VIRTUAL,
__void__requestCompile,
"",
"");
I_Method1(void, compileShader, IN, osg::State &, state,
Properties::NON_VIRTUAL,
__void__compileShader__osg_State_R1,
"",
"");
I_Method0(bool, needsCompile,
Properties::NON_VIRTUAL,
__bool__needsCompile,
"",
"");
I_Method0(bool, isCompiled,
Properties::NON_VIRTUAL,
__bool__isCompiled,
"",
"");
I_Method1(bool, getInfoLog, IN, std::string &, infoLog,
Properties::NON_VIRTUAL,
__bool__getInfoLog__std_string_R1,
"",
"");
I_Method1(void, attachShader, IN, GLuint, program,
Properties::NON_VIRTUAL,
__void__attachShader__GLuint,
"Attach our glShader to a glProgram. ",
"");
I_Method1(void, detachShader, IN, GLuint, program,
Properties::NON_VIRTUAL,
__void__detachShader__GLuint,
"Detach our glShader from a glProgram. ",
"");
I_SimpleProperty(GLuint, Handle,
__GLuint__getHandle,
0);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osg::ShaderBinary) BEGIN_OBJECT_REFLECTOR(osg::ShaderBinary)
I_DeclaringFile("osg/Shader"); I_DeclaringFile("osg/Shader");
I_BaseType(osg::Object); I_BaseType(osg::Object);

View File

@@ -15,7 +15,6 @@
#include <osg/GraphicsContext> #include <osg/GraphicsContext>
#include <osg/Group> #include <osg/Group>
#include <osg/Node> #include <osg/Node>
#include <osg/PagedLOD>
#include <osg/Referenced> #include <osg/Referenced>
#include <osg/State> #include <osg/State>
#include <osgDB/DatabasePager> #include <osgDB/DatabasePager>
@@ -38,8 +37,6 @@ END_REFLECTOR
TYPE_NAME_ALIAS(OpenThreads::Thread::ThreadPriority, osgDB::DatabasePager::ThreadPriority) TYPE_NAME_ALIAS(OpenThreads::Thread::ThreadPriority, osgDB::DatabasePager::ThreadPriority)
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osg::PagedLOD > >, osgDB::DatabasePager::PagedLODList)
TYPE_NAME_ALIAS(std::set< osg::ref_ptr< osg::StateSet > >, osgDB::DatabasePager::StateSetList) TYPE_NAME_ALIAS(std::set< osg::ref_ptr< osg::StateSet > >, osgDB::DatabasePager::StateSetList)
TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osg::Drawable > >, osgDB::DatabasePager::DrawableList) TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osg::Drawable > >, osgDB::DatabasePager::DrawableList)
@@ -405,18 +402,6 @@ BEGIN_OBJECT_REFLECTOR(osgDB::DatabasePager)
__void__removeExpiredSubgraphs__C5_osg_FrameStamp_R1, __void__removeExpiredSubgraphs__C5_osg_FrameStamp_R1,
"Iterate through the active PagedLOD nodes children removing children which havn't been visited since specified expiryTime. ", "Iterate through the active PagedLOD nodes children removing children which havn't been visited since specified expiryTime. ",
"note, should be only be called from the update thread. "); "note, should be only be called from the update thread. ");
I_ProtectedMethod1(void, expiry_removeExpiredSubgraphs, IN, const osg::FrameStamp &, frameStamp,
Properties::VIRTUAL,
Properties::NON_CONST,
__void__expiry_removeExpiredSubgraphs__C5_osg_FrameStamp_R1,
"Old expiry delay based removeExpiredSubgraphs. ",
"");
I_ProtectedMethod1(void, capped_removeExpiredSubgraphs, IN, const osg::FrameStamp &, frameStamp,
Properties::VIRTUAL,
Properties::NON_CONST,
__void__capped_removeExpiredSubgraphs__C5_osg_FrameStamp_R1,
"New capped based removeExpiredSubgraphs. ",
"");
I_ProtectedMethod1(void, addLoadedDataToSceneGraph, IN, const osg::FrameStamp &, frameStamp, I_ProtectedMethod1(void, addLoadedDataToSceneGraph, IN, const osg::FrameStamp &, frameStamp,
Properties::NON_VIRTUAL, Properties::NON_VIRTUAL,
Properties::NON_CONST, Properties::NON_CONST,
@@ -598,46 +583,6 @@ BEGIN_OBJECT_REFLECTOR(osg::observer_ptr< osg::GraphicsContext >)
0); 0);
END_REFLECTOR END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osg::PagedLOD >)
I_DeclaringFile("osg/ref_ptr");
I_Constructor0(____ref_ptr,
"",
"");
I_Constructor1(IN, osg::PagedLOD *, ptr,
Properties::NON_EXPLICIT,
____ref_ptr__T_P1,
"",
"");
I_Constructor1(IN, const osg::ref_ptr< osg::PagedLOD > &, rp,
Properties::NON_EXPLICIT,
____ref_ptr__C5_ref_ptr_R1,
"",
"");
I_Method0(osg::PagedLOD *, get,
Properties::NON_VIRTUAL,
__T_P1__get,
"",
"");
I_Method0(bool, valid,
Properties::NON_VIRTUAL,
__bool__valid,
"",
"");
I_Method0(osg::PagedLOD *, release,
Properties::NON_VIRTUAL,
__T_P1__release,
"",
"");
I_Method1(void, swap, IN, osg::ref_ptr< osg::PagedLOD > &, rp,
Properties::NON_VIRTUAL,
__void__swap__ref_ptr_R1,
"",
"");
I_SimpleProperty(osg::PagedLOD *, ,
__T_P1__get,
0);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgDB::DatabasePager >) BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgDB::DatabasePager >)
I_DeclaringFile("osg/ref_ptr"); I_DeclaringFile("osg/ref_ptr");
I_Constructor0(____ref_ptr, I_Constructor0(____ref_ptr,
@@ -678,8 +623,6 @@ BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgDB::DatabasePager >)
0); 0);
END_REFLECTOR END_REFLECTOR
STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osg::PagedLOD > >)
STD_MAP_REFLECTOR(std::map< unsigned int COMMA osgDB::DatabasePager::DataToCompile >) STD_MAP_REFLECTOR(std::map< unsigned int COMMA osgDB::DatabasePager::DataToCompile >)
STD_PAIR_REFLECTOR(std::pair< osgDB::DatabasePager::StateSetList COMMA osgDB::DatabasePager::DrawableList >) STD_PAIR_REFLECTOR(std::pair< osgDB::DatabasePager::StateSetList COMMA osgDB::DatabasePager::DrawableList >)