fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Base / OSGUniformBufferObjBaseChunk.cpp
blobe0c89758e9b9ad6015b41451bc8a31e454d6dd77
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 //---------------------------------------------------------------------------
40 // Includes
41 //---------------------------------------------------------------------------
43 #include <cstdlib>
44 #include <cstdio>
46 #include <boost/bind.hpp>
48 #include "OSGConfig.h"
50 #include "OSGGL.h"
51 #include "OSGGLU.h"
52 #include "OSGGLEXT.h"
53 #include "OSGWindow.h"
55 #include "OSGGLFuncProtos.h"
57 #include "OSGDrawEnv.h"
59 #include "OSGUniformBufferObjBaseChunk.h"
61 OSG_BEGIN_NAMESPACE
63 // Documentation for this class is emitted in the
64 // OSGUniformBufferObjBaseChunkBase.cpp file.
65 // To modify it, please change the .fcd file (OSGUniformBufferObjBaseChunk.fcd) and
66 // regenerate the base file.
68 /***************************************************************************\
69 * Class variables *
70 \***************************************************************************/
72 StateChunkClass UniformBufferObjBaseChunk::_class("UniformBuffer",
73 osgMaxUniformBufferBindings, // number if slots
74 30); // priority
76 volatile UInt16 UniformBufferObjBaseChunk::_uiChunkCounter = 1;
78 /***************************************************************************\
79 * Class methods *
80 \***************************************************************************/
82 void UniformBufferObjBaseChunk::initMethod(InitPhase ePhase)
84 Inherited::initMethod(ePhase);
86 if(ePhase == TypeObject::SystemPost)
92 /***************************************************************************\
93 * Instance methods *
94 \***************************************************************************/
96 /*-------------------------------------------------------------------------*\
97 - private -
98 \*-------------------------------------------------------------------------*/
100 /*----------------------- constructors & destructors ----------------------*/
102 UniformBufferObjBaseChunk::UniformBufferObjBaseChunk(void) :
103 Inherited(),
104 _uiChunkId(0)
108 UniformBufferObjBaseChunk::UniformBufferObjBaseChunk(const UniformBufferObjBaseChunk &source) :
109 Inherited(source),
110 _uiChunkId(0)
114 UniformBufferObjBaseChunk::~UniformBufferObjBaseChunk(void)
118 /*----------------------------- class specific ----------------------------*/
120 const StateChunkClass *UniformBufferObjBaseChunk::getClass(void) const
122 return &_class;
125 void UniformBufferObjBaseChunk::changed(ConstFieldMaskArg whichField,
126 UInt32 origin,
127 BitVector details)
129 Inherited::changed(whichField, origin, details);
132 /*----------------------------- onCreate --------------------------------*/
134 void UniformBufferObjBaseChunk::onCreate(const UniformBufferObjBaseChunk *source)
136 Inherited::onCreate(source);
138 if(GlobalSystemState == Startup)
139 return;
141 _uiChunkId = _uiChunkCounter++;
144 void UniformBufferObjBaseChunk::onCreateAspect(const UniformBufferObjBaseChunk *createAspect,
145 const UniformBufferObjBaseChunk *source )
147 Inherited::onCreateAspect(createAspect, source);
149 _uiChunkId = createAspect->_uiChunkId;
152 /*------------------------------ Output ----------------------------------*/
154 void UniformBufferObjBaseChunk::dump( UInt32 ,
155 const BitVector ) const
157 SLOG << "Dump UniformBufferObjBaseChunk NI" << std::endl;
160 OSG_END_NAMESPACE