changed: gcc8 base update
[opensg.git] / Source / System / State / Shader / Chunks / OSGShaderProgramChunk.h
blob8e906d5790690f62981bd6fe89303099dcc57407
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGSHADERPROGRAMCHUNK_H_
40 #define _OSGSHADERPROGRAMCHUNK_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGShaderProgramChunkBase.h"
47 OSG_BEGIN_NAMESPACE
49 /*! \brief ShaderProgramChunk class. See \ref
50 PageSystemShaderProgramChunk for a description.
51 \ingroup GrpSystemShaderChunks
52 \ingroup GrpLibOSGSystem
53 \includebasedoc
56 class OSG_SYSTEM_DLLMAPPING ShaderProgramChunk : public ShaderProgramChunkBase
58 protected:
60 /*========================== PUBLIC =================================*/
62 public:
64 typedef ShaderProgramChunkBase Inherited;
65 typedef ShaderProgramChunk Self;
67 /*---------------------------------------------------------------------*/
68 /*! \name Chunk Class Access */
69 /*! \{ */
71 virtual const StateChunkClass *getClass(void) const;
73 /*! \} */
74 /*---------------------------------------------------------------------*/
75 /*! \name Static Chunk Class Access */
76 /*! \{ */
78 static UInt32 getStaticClassId(void);
79 static const StateChunkClass *getStaticClass (void);
81 /*! \} */
82 /*---------------------------------------------------------------------*/
83 /*! \name Chunk Id */
84 /*! \{ */
86 virtual UInt16 getChunkId(void);
88 /*! \} */
89 /*---------------------------------------------------------------------*/
90 /*! \name Sync */
91 /*! \{ */
93 virtual void changed(ConstFieldMaskArg whichField,
94 UInt32 origin,
95 BitVector details );
97 /*! \} */
98 /*---------------------------------------------------------------------*/
99 /*! \name Output */
100 /*! \{ */
102 void addShader(ShaderProgram * const value);
104 /*! \} */
105 /*---------------------------------------------------------------------*/
106 /*! \name Output */
107 /*! \{ */
109 virtual void activate (DrawEnv *pEnv,
110 UInt32 uiIdx = 0);
111 virtual void changeFrom(DrawEnv *pEnv,
112 StateChunk *pOld,
113 UInt32 uiIdx = 0);
114 virtual void deactivate(DrawEnv *pEnv,
115 UInt32 uiIdx = 0);
117 /*! \} */
118 /*---------------------------------------------------------------------*/
119 /*! \name Output */
120 /*! \{ */
122 virtual void dump( UInt32 uiIndent = 0,
123 const BitVector bvFlags = 0) const;
125 /*! \} */
126 /*========================= PROTECTED ===============================*/
128 protected:
130 static UInt32 _extSHL;
132 /*---------------------------------------------------------------------*/
134 static volatile UInt16 _uiChunkCounter;
136 UInt16 _uiChunkId;
138 /*---------------------------------------------------------------------*/
139 /*! \name Constructors */
140 /*! \{ */
142 ShaderProgramChunk(void);
143 ShaderProgramChunk(const ShaderProgramChunk &source);
145 /*! \} */
146 /*---------------------------------------------------------------------*/
147 /*! \name Destructors */
148 /*! \{ */
150 virtual ~ShaderProgramChunk(void);
152 /*! \} */
153 /*---------------------------------------------------------------------*/
154 /*! \name Init */
155 /*! \{ */
157 static void initMethod(InitPhase ePhase);
159 /*! \} */
160 /*---------------------------------------------------------------------*/
161 /*! \name Init */
162 /*! \{ */
164 void onCreate (const ShaderProgramChunk *source = NULL);
165 void onCreateAspect(const ShaderProgramChunk *createAspect,
166 const ShaderProgramChunk *source = NULL);
167 void onDestroy( UInt32 uiId );
169 /*! \} */
170 /*========================== PRIVATE ================================*/
172 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;
186 OSG_END_NAMESPACE
188 #include "OSGShaderProgramChunkBase.inl"
189 #include "OSGShaderProgramChunk.inl"
191 #endif /* _OSGSHADERPROGRAMCHUNK_H_ */