1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGSHADERPROGRAMCHUNK_H_
40 #define _OSGSHADERPROGRAMCHUNK_H_
45 #include "OSGShaderProgramChunkBase.h"
49 /*! \brief ShaderProgramChunk class. See \ref
50 PageSystemShaderProgramChunk for a description.
51 \ingroup GrpSystemShaderChunks
52 \ingroup GrpLibOSGSystem
56 class OSG_SYSTEM_DLLMAPPING ShaderProgramChunk
: public ShaderProgramChunkBase
60 /*========================== PUBLIC =================================*/
64 typedef ShaderProgramChunkBase Inherited
;
65 typedef ShaderProgramChunk Self
;
67 /*---------------------------------------------------------------------*/
68 /*! \name Chunk Class Access */
71 virtual const StateChunkClass
*getClass(void) const;
74 /*---------------------------------------------------------------------*/
75 /*! \name Static Chunk Class Access */
78 static UInt32
getStaticClassId(void);
79 static const StateChunkClass
*getStaticClass (void);
82 /*---------------------------------------------------------------------*/
86 virtual UInt16
getChunkId(void);
89 /*---------------------------------------------------------------------*/
93 virtual void changed(ConstFieldMaskArg whichField
,
98 /*---------------------------------------------------------------------*/
102 void addShader(ShaderProgram
* const value
);
105 /*---------------------------------------------------------------------*/
109 virtual void activate (DrawEnv
*pEnv
,
111 virtual void changeFrom(DrawEnv
*pEnv
,
114 virtual void deactivate(DrawEnv
*pEnv
,
118 /*---------------------------------------------------------------------*/
122 virtual void dump( UInt32 uiIndent
= 0,
123 const BitVector bvFlags
= 0) const;
126 /*========================= PROTECTED ===============================*/
130 static UInt32 _extSHL
;
132 /*---------------------------------------------------------------------*/
134 static volatile UInt16 _uiChunkCounter
;
138 /*---------------------------------------------------------------------*/
139 /*! \name Constructors */
142 ShaderProgramChunk(void);
143 ShaderProgramChunk(const ShaderProgramChunk
&source
);
146 /*---------------------------------------------------------------------*/
147 /*! \name Destructors */
150 virtual ~ShaderProgramChunk(void);
153 /*---------------------------------------------------------------------*/
157 static void initMethod(InitPhase ePhase
);
160 /*---------------------------------------------------------------------*/
164 void onCreate (const ShaderProgramChunk
*source
= NULL
);
165 void onCreateAspect(const ShaderProgramChunk
*createAspect
,
166 const ShaderProgramChunk
*source
= NULL
);
167 void onDestroy( UInt32 uiId
);
170 /*========================== PRIVATE ================================*/
174 // class. Used for indexing in State
175 static StateChunkClass _class
;
177 friend class FieldContainer
;
178 friend class ShaderProgramChunkBase
;
180 // prohibit default functions (move to 'public' if you need one)
181 void operator =(const ShaderProgramChunk
&source
);
184 typedef ShaderProgramChunk
*ShaderProgramChunkP
;
188 #include "OSGShaderProgramChunkBase.inl"
189 #include "OSGShaderProgramChunk.inl"
191 #endif /* _OSGSHADERPROGRAMCHUNK_H_ */