1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGRENDERBUFFERBASE_H_
55 #define _OSGRENDERBUFFERBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGFrameBufferAttachment.h" // Parent
68 #include "OSGBaseFields.h" // GLId type
69 #include "OSGImageFields.h" // Image type
70 #include "OSGSysFields.h" // ColorSamples type
72 #include "OSGRenderBufferFields.h"
79 //! \brief RenderBuffer Base Class.
81 class OSG_SYSTEM_DLLMAPPING RenderBufferBase
: public FrameBufferAttachment
85 typedef FrameBufferAttachment Inherited
;
86 typedef FrameBufferAttachment ParentContainer
;
88 typedef Inherited::TypeObject TypeObject
;
89 typedef TypeObject::InitPhase InitPhase
;
91 OSG_GEN_INTERNALPTR(RenderBuffer
);
93 /*========================== PUBLIC =================================*/
99 GLIdFieldId
= Inherited::NextFieldId
,
100 InternalFormatFieldId
= GLIdFieldId
+ 1,
101 ImageFieldId
= InternalFormatFieldId
+ 1,
102 ColorSamplesFieldId
= ImageFieldId
+ 1,
103 CoverageSamplesFieldId
= ColorSamplesFieldId
+ 1,
104 FixedSampleLocationFieldId
= CoverageSamplesFieldId
+ 1,
105 NextFieldId
= FixedSampleLocationFieldId
+ 1
108 static const OSG::BitVector GLIdFieldMask
=
109 (TypeTraits
<BitVector
>::One
<< GLIdFieldId
);
110 static const OSG::BitVector InternalFormatFieldMask
=
111 (TypeTraits
<BitVector
>::One
<< InternalFormatFieldId
);
112 static const OSG::BitVector ImageFieldMask
=
113 (TypeTraits
<BitVector
>::One
<< ImageFieldId
);
114 static const OSG::BitVector ColorSamplesFieldMask
=
115 (TypeTraits
<BitVector
>::One
<< ColorSamplesFieldId
);
116 static const OSG::BitVector CoverageSamplesFieldMask
=
117 (TypeTraits
<BitVector
>::One
<< CoverageSamplesFieldId
);
118 static const OSG::BitVector FixedSampleLocationFieldMask
=
119 (TypeTraits
<BitVector
>::One
<< FixedSampleLocationFieldId
);
120 static const OSG::BitVector NextFieldMask
=
121 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
123 typedef SFGLenum SFGLIdType
;
124 typedef SFGLenum SFInternalFormatType
;
125 typedef SFUnrecImagePtr SFImageType
;
126 typedef SFUInt32 SFColorSamplesType
;
127 typedef SFUInt32 SFCoverageSamplesType
;
128 typedef SFBool SFFixedSampleLocationType
;
130 /*---------------------------------------------------------------------*/
131 /*! \name Class Get */
134 static FieldContainerType
&getClassType (void);
135 static UInt32
getClassTypeId (void);
136 static UInt16
getClassGroupId(void);
139 /*---------------------------------------------------------------------*/
140 /*! \name FieldContainer Get */
143 virtual FieldContainerType
&getType (void);
144 virtual const FieldContainerType
&getType (void) const;
146 virtual UInt32
getContainerSize(void) const;
149 /*---------------------------------------------------------------------*/
150 /*! \name Field Get */
154 SFGLenum
*editSFGLId (void);
155 const SFGLenum
*getSFGLId (void) const;
157 SFGLenum
*editSFInternalFormat (void);
158 const SFGLenum
*getSFInternalFormat (void) const;
159 const SFUnrecImagePtr
*getSFImage (void) const;
160 SFUnrecImagePtr
*editSFImage (void);
162 SFUInt32
*editSFColorSamples (void);
163 const SFUInt32
*getSFColorSamples (void) const;
165 SFUInt32
*editSFCoverageSamples(void);
166 const SFUInt32
*getSFCoverageSamples (void) const;
168 SFBool
*editSFFixedSampleLocation(void);
169 const SFBool
*getSFFixedSampleLocation (void) const;
172 GLenum
&editGLId (void);
173 const GLenum
&getGLId (void) const;
175 GLenum
&editInternalFormat (void);
176 const GLenum
&getInternalFormat (void) const;
178 Image
* getImage (void) const;
180 UInt32
&editColorSamples (void);
181 UInt32
getColorSamples (void) const;
183 UInt32
&editCoverageSamples(void);
184 UInt32
getCoverageSamples (void) const;
186 bool &editFixedSampleLocation(void);
187 bool getFixedSampleLocation (void) const;
190 /*---------------------------------------------------------------------*/
191 /*! \name Field Set */
194 void setGLId (const GLenum
&value
);
195 void setInternalFormat (const GLenum
&value
);
196 void setImage (Image
* const value
);
197 void setColorSamples (const UInt32 value
);
198 void setCoverageSamples(const UInt32 value
);
199 void setFixedSampleLocation(const bool value
);
202 /*---------------------------------------------------------------------*/
203 /*! \name Ptr Field Set */
207 /*---------------------------------------------------------------------*/
208 /*! \name Ptr MField Set */
212 /*---------------------------------------------------------------------*/
213 /*! \name Binary Access */
216 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
217 virtual void copyToBin (BinaryDataHandler
&pMem
,
218 ConstFieldMaskArg whichField
);
219 virtual void copyFromBin(BinaryDataHandler
&pMem
,
220 ConstFieldMaskArg whichField
);
224 /*---------------------------------------------------------------------*/
225 /*! \name Construction */
228 static RenderBufferTransitPtr
create (void);
229 static RenderBuffer
*createEmpty (void);
231 static RenderBufferTransitPtr
createLocal (
232 BitVector bFlags
= FCLocal::All
);
234 static RenderBuffer
*createEmptyLocal(
235 BitVector bFlags
= FCLocal::All
);
237 static RenderBufferTransitPtr
createDependent (BitVector bFlags
);
240 /*---------------------------------------------------------------------*/
244 virtual FieldContainerTransitPtr
shallowCopy (void) const;
245 virtual FieldContainerTransitPtr
shallowCopyLocal(
246 BitVector bFlags
= FCLocal::All
) const;
247 virtual FieldContainerTransitPtr
shallowCopyDependent(
248 BitVector bFlags
) const;
251 /*========================= PROTECTED ===============================*/
255 static TypeObject _type
;
257 static void classDescInserter(TypeObject
&oType
);
258 static const Char8
*getClassname (void );
260 /*---------------------------------------------------------------------*/
265 SFGLenum _sfInternalFormat
;
266 SFUnrecImagePtr _sfImage
;
267 SFUInt32 _sfColorSamples
;
268 SFUInt32 _sfCoverageSamples
;
269 SFBool _sfFixedSampleLocation
;
272 /*---------------------------------------------------------------------*/
273 /*! \name Constructors */
276 RenderBufferBase(void);
277 RenderBufferBase(const RenderBufferBase
&source
);
280 /*---------------------------------------------------------------------*/
281 /*! \name Destructors */
284 virtual ~RenderBufferBase(void);
287 /*---------------------------------------------------------------------*/
288 /*! \name onCreate */
291 void onCreate(const RenderBuffer
*source
= NULL
);
294 /*---------------------------------------------------------------------*/
295 /*! \name Generic Field Access */
298 GetFieldHandlePtr
getHandleGLId (void) const;
299 EditFieldHandlePtr
editHandleGLId (void);
300 GetFieldHandlePtr
getHandleInternalFormat (void) const;
301 EditFieldHandlePtr
editHandleInternalFormat (void);
302 GetFieldHandlePtr
getHandleImage (void) const;
303 EditFieldHandlePtr
editHandleImage (void);
304 GetFieldHandlePtr
getHandleColorSamples (void) const;
305 EditFieldHandlePtr
editHandleColorSamples (void);
306 GetFieldHandlePtr
getHandleCoverageSamples (void) const;
307 EditFieldHandlePtr
editHandleCoverageSamples(void);
308 GetFieldHandlePtr
getHandleFixedSampleLocation (void) const;
309 EditFieldHandlePtr
editHandleFixedSampleLocation(void);
312 /*---------------------------------------------------------------------*/
316 #ifdef OSG_MT_CPTR_ASPECT
317 virtual void execSyncV( FieldContainer
&oFrom
,
318 ConstFieldMaskArg whichField
,
319 AspectOffsetStore
&oOffsets
,
320 ConstFieldMaskArg syncMode
,
321 const UInt32 uiSyncInfo
);
323 void execSync ( RenderBufferBase
*pFrom
,
324 ConstFieldMaskArg whichField
,
325 AspectOffsetStore
&oOffsets
,
326 ConstFieldMaskArg syncMode
,
327 const UInt32 uiSyncInfo
);
331 /*---------------------------------------------------------------------*/
336 /*---------------------------------------------------------------------*/
337 /*! \name Aspect Create */
340 #ifdef OSG_MT_CPTR_ASPECT
341 virtual FieldContainer
*createAspectCopy(
342 const FieldContainer
*pRefAspect
) const;
346 /*---------------------------------------------------------------------*/
350 /*---------------------------------------------------------------------*/
354 virtual void resolveLinks(void);
357 /*========================== PRIVATE ================================*/
360 /*---------------------------------------------------------------------*/
362 // prohibit default functions (move to 'public' if you need one)
363 void operator =(const RenderBufferBase
&source
);
366 typedef RenderBufferBase
*RenderBufferBaseP
;
370 #endif /* _OSGRENDERBUFFERBASE_H_ */