1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 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 _OSGFRAMEBUFFEROBJECT_H_
40 #define _OSGFRAMEBUFFEROBJECT_H_
45 #include "OSGFrameBufferObjectBase.h"
46 #include "OSGWindow.h"
53 /*! \brief Viewport class for color channel selection. See \ref
54 PageSystemFBOBuffer for a description.
55 \ingroup GrpSystemWindowFBOObj
56 \ingroup GrpLibOSGSystem
60 class OSG_SYSTEM_DLLMAPPING FrameBufferObject
:
61 public FrameBufferObjectBase
65 /*========================== PUBLIC =================================*/
69 typedef FrameBufferObjectBase Inherited
;
71 /*---------------------------------------------------------------------*/
75 virtual void changed(ConstFieldMaskArg whichField
,
80 /*---------------------------------------------------------------------*/
84 void setSize (UInt32 uiWidth
, UInt32 uiHeight
);
86 void resizeAll(UInt32 uiWidth
, UInt32 uiHeight
);
89 /*---------------------------------------------------------------------*/
90 /*! \name Attachments */
93 void setColorAttachment(FrameBufferAttachment
*pAttachment
,
97 /*---------------------------------------------------------------------*/
101 virtual void dump( UInt32 uiIndent
= 0,
102 const BitVector bvFlags
= 0) const;
105 /*---------------------------------------------------------------------*/
106 /*! \name your_category */
109 virtual void activate (DrawEnv
*pEnv
,
110 GLenum eDrawBuffer
= GL_NONE
);
111 virtual void deactivate (DrawEnv
*pEnv
);
114 /*---------------------------------------------------------------------*/
115 /*! \name your_category */
118 static void activateFBOById (DrawEnv
*pEnv
, UInt32 uiOSGId
);
119 static void deactivateFBOById(DrawEnv
*pEnv
);
122 /*========================= PROTECTED ===============================*/
126 // Variables should all be in FrameBufferObjectBase.
128 /*---------------------------------------------------------------------*/
129 /*! \name Constructors */
132 FrameBufferObject(void);
133 FrameBufferObject(const FrameBufferObject
&source
);
136 /*---------------------------------------------------------------------*/
137 /*! \name Destructors */
140 virtual ~FrameBufferObject(void);
143 /*---------------------------------------------------------------------*/
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
,
162 Window::GLObjectStatusE mode
,
163 UInt64 uiOptions
) const;
164 static void handleDestroyGL (DrawEnv
*pEnv
,
166 Window::GLObjectStatusE mode
);
168 UInt32
handleMultiSampleGL(DrawEnv
*pEnv
,
170 Window::GLObjectStatusE mode
,
171 UInt64 uiOptions
) const;
174 /*---------------------------------------------------------------------*/
178 FrameBufferAttachmentTransitPtr
179 createMultiSampleBufferFrom(FrameBufferAttachment
*pSrc
);
182 /*---------------------------------------------------------------------*/
186 static void initMethod(InitPhase ePhase
);
189 /*---------------------------------------------------------------------*/
193 void onCreate (const FrameBufferObject
*source
= NULL
);
194 void onDestroy( UInt32 uiContainerId
);
197 /*========================== 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
;
212 #include "OSGFrameBufferObjectBase.inl"
213 #include "OSGFrameBufferObject.inl"
215 #endif /* _OSGFRAMEBUFFEROBJECT_H_ */