fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Window / FrameBufferObjects / OSGFrameBufferObject.h
blobaa1818f90eedeae570d5b32f1070f679fc517c7a
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 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 _OSGFRAMEBUFFEROBJECT_H_
40 #define _OSGFRAMEBUFFEROBJECT_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGFrameBufferObjectBase.h"
46 #include "OSGWindow.h"
48 OSG_BEGIN_NAMESPACE
50 class DrawEnv;
51 class Window;
53 /*! \brief Viewport class for color channel selection. See \ref
54 PageSystemFBOBuffer for a description.
55 \ingroup GrpSystemWindowFBOObj
56 \ingroup GrpLibOSGSystem
57 \includebasedoc
60 class OSG_SYSTEM_DLLMAPPING FrameBufferObject :
61 public FrameBufferObjectBase
63 private:
65 /*========================== PUBLIC =================================*/
67 public:
69 typedef FrameBufferObjectBase Inherited;
71 /*---------------------------------------------------------------------*/
72 /*! \name Sync */
73 /*! \{ */
75 virtual void changed(ConstFieldMaskArg whichField,
76 UInt32 origin,
77 BitVector detail);
79 /*! \} */
80 /*---------------------------------------------------------------------*/
81 /*! \name Sync */
82 /*! \{ */
84 void setSize (UInt32 uiWidth, UInt32 uiHeight);
86 void resizeAll(UInt32 uiWidth, UInt32 uiHeight);
88 /*! \} */
89 /*---------------------------------------------------------------------*/
90 /*! \name Attachments */
91 /*! \{ */
93 void setColorAttachment(FrameBufferAttachment *pAttachment,
94 UInt32 uiSlot );
96 /*! \} */
97 /*---------------------------------------------------------------------*/
98 /*! \name Output */
99 /*! \{ */
101 virtual void dump( UInt32 uiIndent = 0,
102 const BitVector bvFlags = 0) const;
104 /*! \} */
105 /*---------------------------------------------------------------------*/
106 /*! \name your_category */
107 /*! \{ */
109 virtual void activate (DrawEnv *pEnv,
110 GLenum eDrawBuffer = GL_NONE);
111 virtual void deactivate (DrawEnv *pEnv);
113 /*! \} */
114 /*---------------------------------------------------------------------*/
115 /*! \name your_category */
116 /*! \{ */
118 static void activateFBOById (DrawEnv *pEnv, UInt32 uiOSGId);
119 static void deactivateFBOById(DrawEnv *pEnv);
121 /*! \} */
122 /*========================= PROTECTED ===============================*/
124 protected:
126 // Variables should all be in FrameBufferObjectBase.
128 /*---------------------------------------------------------------------*/
129 /*! \name Constructors */
130 /*! \{ */
132 FrameBufferObject(void);
133 FrameBufferObject(const FrameBufferObject &source);
135 /*! \} */
136 /*---------------------------------------------------------------------*/
137 /*! \name Destructors */
138 /*! \{ */
140 virtual ~FrameBufferObject(void);
142 /*! \} */
143 /*---------------------------------------------------------------------*/
144 /*! \name GL */
145 /*! \{ */
147 static UInt32 _uiFramebufferObjectArb;
148 static UInt32 _uiFramebufferBlitExt;
149 static UInt32 _uiPackedDepthStencilExt;
151 static UInt32 _uiFuncGenFramebuffers;
152 static UInt32 _uiFuncCheckFramebufferStatus;
153 static UInt32 _uiFuncBindFramebuffer;
154 static UInt32 _uiFuncDeleteFramebuffers;
155 static UInt32 _uiFuncFramebufferRenderbuffer;
156 static UInt32 _uiFuncDrawBuffers;
157 static UInt32 _uiFuncBlitFramebuffer;
160 UInt32 handleGL (DrawEnv *pEnv,
161 UInt32 id,
162 Window::GLObjectStatusE mode,
163 UInt64 uiOptions) const;
164 static void handleDestroyGL (DrawEnv *pEnv,
165 UInt32 id,
166 Window::GLObjectStatusE mode );
168 UInt32 handleMultiSampleGL(DrawEnv *pEnv,
169 UInt32 id,
170 Window::GLObjectStatusE mode,
171 UInt64 uiOptions) const;
173 /*! \} */
174 /*---------------------------------------------------------------------*/
175 /*! \name Init */
176 /*! \{ */
178 FrameBufferAttachmentTransitPtr
179 createMultiSampleBufferFrom(FrameBufferAttachment *pSrc);
181 /*! \} */
182 /*---------------------------------------------------------------------*/
183 /*! \name Init */
184 /*! \{ */
186 static void initMethod(InitPhase ePhase);
188 /*! \} */
189 /*---------------------------------------------------------------------*/
190 /*! \name Init */
191 /*! \{ */
193 void onCreate (const FrameBufferObject *source = NULL);
194 void onDestroy( UInt32 uiContainerId );
196 /*! \} */
197 /*========================== PRIVATE ================================*/
199 private:
201 friend class FieldContainer;
202 friend class FrameBufferObjectBase;
204 // prohibit default functions (move to 'public' if you need one)
205 void operator =(const FrameBufferObject &source);
208 typedef FrameBufferObject *FrameBufferObjectP;
210 OSG_END_NAMESPACE
212 #include "OSGFrameBufferObjectBase.inl"
213 #include "OSGFrameBufferObject.inl"
215 #endif /* _OSGFRAMEBUFFEROBJECT_H_ */