WIN32Window Base Class.
#include <OSGWIN32WindowBase.h>
Public Types | |
| enum | { HwndFieldId = Inherited::NextFieldId, HdcFieldId = HwndFieldId + 1, HglrcFieldId = HdcFieldId + 1, NextFieldId = HglrcFieldId + 1 } |
| typedef WIN32WindowPtr | Ptr |
| enum | GLObjectStatusE { notused = 1, initialize, reinitialize, initialized, needrefresh, destroy, finaldestroy } |
| enum | { invalidExtensionID = 0x7fffffff, invalidFunctionID = 0x7fffffff } |
| enum | { statusShift = 3, statusMask = 7 } |
| typedef ArgsCollector< UInt32 > | GLObjectFunctorArgs |
| typedef TypedVoidFunctor2Base < PtrCallArg< Window > , GLObjectFunctorArgs > | GLObjectFunctor |
| typedef void(* | GLExtensionFunction )(void) |
| enum | { WidthFieldId = Inherited::NextFieldId, HeightFieldId = WidthFieldId + 1, PortFieldId = HeightFieldId + 1, ResizePendingFieldId = PortFieldId + 1, GlObjectEventCounterFieldId = ResizePendingFieldId + 1, GlObjectLastRefreshFieldId = GlObjectEventCounterFieldId + 1, GlObjectLastReinitializeFieldId = GlObjectLastRefreshFieldId + 1, NextFieldId = GlObjectLastReinitializeFieldId + 1 } |
| enum | { AttachmentsFieldId = Inherited::NextFieldId, NextFieldId = AttachmentsFieldId + 1 } |
| enum | { NextFieldId = 1 } |
Public Member Functions | |
FieldContainer Get | |
| virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| SFHWND * | editSFHwnd (void) |
| Get the WIN32Window::_sfHwnd field. | |
| const SFHWND * | getSFHwnd (void) const |
| Get the WIN32Window::_sfHwnd field. | |
| SFHWND * | getSFHwnd (void) |
| Get the WIN32Window::_sfHwnd field. | |
| SFHDC * | editSFHdc (void) |
| Get the WIN32Window::_sfHdc field. | |
| const SFHDC * | getSFHdc (void) const |
| Get the WIN32Window::_sfHdc field. | |
| SFHDC * | getSFHdc (void) |
| Get the WIN32Window::_sfHdc field. | |
| SFHGLRC * | editSFHglrc (void) |
| Get the WIN32Window::_sfHglrc field. | |
| const SFHGLRC * | getSFHglrc (void) const |
| Get the WIN32Window::_sfHglrc field. | |
| SFHGLRC * | getSFHglrc (void) |
| Get the WIN32Window::_sfHglrc field. | |
| HWND & | editHwnd (void) |
| Get the value of the WIN32Window::_sfHwnd field. | |
| const HWND & | getHwnd (void) const |
| Get the value of the WIN32Window::_sfHwnd field. | |
| HWND & | getHwnd (void) |
| Get the value of the WIN32Window::_sfHwnd field. | |
| HDC & | editHdc (void) |
| Get the value of the WIN32Window::_sfHdc field. | |
| const HDC & | getHdc (void) const |
| Get the value of the WIN32Window::_sfHdc field. | |
| HDC & | getHdc (void) |
| Get the value of the WIN32Window::_sfHdc field. | |
| HGLRC & | editHglrc (void) |
| Get the value of the WIN32Window::_sfHglrc field. | |
| const HGLRC & | getHglrc (void) const |
| Get the value of the WIN32Window::_sfHglrc field. | |
| HGLRC & | getHglrc (void) |
| Get the value of the WIN32Window::_sfHglrc field. | |
Field Set | |
| void | setHwnd (const HWND &value) |
| Set the value of the WIN32Window::_sfHwnd field. | |
| void | setHdc (const HDC &value) |
| Set the value of the WIN32Window::_sfHdc field. | |
| void | setHglrc (const HGLRC &value) |
| Set the value of the WIN32Window::_sfHglrc field. | |
Binary Access | |
| virtual UInt32 | getBinSize (const BitVector &whichField) |
| virtual void | copyToBin (BinaryDataHandler &pMem, const BitVector &whichField) |
| virtual void | copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField) |
Copy | |
| virtual FieldContainerPtr | shallowCopy (void) const |
Sync | |
| virtual void | changed (BitVector whichField, UInt32 origin) |
Viewport handling | |
| void | addPort (const ViewportPtr &portP) |
| void | insertPort (UInt32 portIndex, const ViewportPtr &portP) |
| void | replacePort (UInt32 portIndex, const ViewportPtr &portP) |
| void | replacePortBy (const ViewportPtr &portP, const ViewportPtr &newPortP) |
| void | subPort (const ViewportPtr &portP) |
| void | subPort (UInt32 portIndex) |
| void | subPortByObj (const ViewportPtr &portP) |
| void | clearPorts (void) |
Size handling | |
| bool | isResizePending (void) |
| virtual void | resize (int width, int height) |
| virtual void | resizeGL (void) |
| void | setSize (UInt16 width, UInt16 height) |
Drawing | |
| virtual void | frameInit (void) |
| virtual void | frameExit (void) |
| virtual void | draw (DrawAction *action=NULL) |
| virtual void | drawAllViewports (DrawAction *action=NULL) |
| virtual void | render (RenderActionBase *action=NULL) |
| virtual void | renderAllViewports (RenderActionBase *action=NULL) |
Window system implementation functions | |
| virtual void | init (void)=0 |
| virtual void | activate (void)=0 |
| virtual void | deactivate (void)=0 |
| virtual void | swap (void)=0 |
Output | |
| virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
Handle Attachments | |
| void | addAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0) |
| void | subAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0) |
| AttachmentPtr | findAttachment (UInt32 groupId, UInt16 binding=0) |
| AttachmentPtr | findAttachment (const FieldContainerType &type, UInt16 binding=0) |
| SFAttachmentMap * | getSFAttachments (void) |
Get Instance Type Information | |
| UInt32 | getTypeId (void) const |
| UInt16 | getGroupId (void) const |
| const Char8 * | getTypeName (void) const |
| Field * | getField (UInt32 fieldId) |
| Field * | getField (const Char8 *fieldName) |
Static Public Member Functions | |
Class Get | |
| static FieldContainerType & | getClassType (void) |
| access the type of the class | |
| static UInt32 | getClassTypeId (void) |
| access the numerical type of the class | |
Construction | |
| static WIN32WindowPtr | create (void) |
| create a new instance of the class | |
| static WIN32WindowPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Class Get | |
| static const char * | getClassname (void) |
Extension registration | |
| static UInt32 | registerExtension (const Char8 *s) |
| static void | ignoreExtensions (const Char8 *s) |
| static UInt32 | registerFunction (const Char8 *s, Int32 ext=-1, UInt32 version=0xffff) |
| static void | registerConstant (GLenum val) |
GL object registration | |
| static UInt32 | registerGLObject (GLObjectFunctor functor, UInt32 num=1) |
Get Class Type Information | |
| static UInt16 | getClassGroupId (void) |
Static Public Attributes | |
| static const osg::BitVector | HwndFieldMask |
| static const osg::BitVector | HdcFieldMask |
| static const osg::BitVector | HglrcFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const Real32 | unknownConstant = -1e100 |
| static const osg::BitVector | WidthFieldMask |
| static const osg::BitVector | HeightFieldMask |
| static const osg::BitVector | PortFieldMask |
| static const osg::BitVector | ResizePendingFieldMask |
| static const osg::BitVector | GlObjectEventCounterFieldMask |
| static const osg::BitVector | GlObjectLastRefreshFieldMask |
| static const osg::BitVector | GlObjectLastReinitializeFieldMask |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
CoredNodePtr helper | |
| static const bool | isNodeCore = false |
Protected Types | |
Map for GL cvonstant handling | |
| typedef std::map< GLenum, Vec2f > | ConstHash |
Protected Member Functions | |
Constructors | |
| WIN32WindowBase (void) | |
| WIN32WindowBase (const WIN32WindowBase &source) | |
Destructors | |
| virtual | ~WIN32WindowBase (void) |
Sync | |
| void | executeSyncImpl (WIN32WindowBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
GL setup handling | |
| virtual void | setupGL (void) |
Sync | |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField)=0 |
Pointer | |
| AttachmentContainerPtr | getPtr (void) |
MT Edit | |
| template<class FieldTypeT > | |
| void | beginEditX (const BitVector &whichField, FieldTypeT &field) |
| template<class FieldTypeT > | |
| void | endEditX (const BitVector &whichField, FieldTypeT &field) |
Static Protected Member Functions | |
Create Fieldcontainer | |
| template<class ObjectPtrT > | |
| static void | newPtr (ObjectPtrT &result, const typename ObjectPtrT::StoredObjectType *prototypeP) |
| template<class ObjectPtrT > | |
| static void | newPtr (ObjectPtrT &result) |
Protected Attributes | |
Fields | |
| SFHWND | _sfHwnd |
| SFHDC | _sfHdc |
| SFHGLRC | _sfHglrc |
Fields | |
| SFUInt16 | _sfWidth |
| SFUInt16 | _sfHeight |
| MFViewportPtr | _mfPort |
| SFBool | _sfResizePending |
| SFUInt32 | _sfGlObjectEventCounter |
| MFUInt32 | _mfGlObjectLastRefresh |
| MFUInt32 | _mfGlObjectLastReinitialize |
Fields | |
| SFAttachmentMap | _attachmentMap |
Member | |
| UInt32 | _shares |
Private Types | |
| typedef Window | Inherited |
Private Member Functions | |
| void | operator= (const WIN32WindowBase &source) |
Static Private Attributes | |
| static FieldDescription * | _desc [] |
| WIN32Window description. | |
| static FieldContainerType | _type |
Friends | |
| class | FieldContainer |
GL object handling helper class | |
| class | GLObject |
Extension handling | |
|
| |
| static void | setGLLibraryName (const Char8 *s) |
| static Int32 | getExtensionId (const Char8 *s) |
| static bool | hasCommonExtension (UInt32 id) |
| static const std::vector < std::string > & | getRegisteredExtensions (void) |
| UInt32 | getGLVersion (void) |
| bool | hasExtension (UInt32 id) |
| bool | hasExtension (const Char8 *s) |
| GLExtensionFunction | getFunction (UInt32 id) |
| GLExtensionFunction | getFunctionNoCheck (UInt32 id) |
| void | dumpExtensions (void) |
| GLExtensionFunction | getFunctionByName (const Char8 *s) |
| Real32 | getConstantValue (GLenum val) |
| const Vec2f & | getConstantValuev (GLenum val) |
| const std::vector< std::string > & | getRegisteredFunctions (void) |
| const std::vector< std::string > & | getExtensions (void) |
| const std::vector< std::string > & | getIgnoredExtensions (void) |
GL object handling | |
|
| |
| static UInt32 | getGLObjectsSize (void) |
| static void | refreshGLObject (UInt32 id) |
| static void | refreshAllGLObjects (void) |
| static void | reinitializeGLObject (UInt32 id) |
| static void | reinitializeAllGLObjects (void) |
| static void | destroyGLObject (UInt32 id, UInt32 num=1) |
| static void | unpackIdStatus (UInt32 idstatus, UInt32 &id, GLObjectStatusE &status) |
| void | validateGLObject (UInt32 id) |
| void | validateAllGLObjects (void) |
| void | setGLObjectId (UInt32 id, UInt32 id2) |
| UInt32 | getGLObjectId (UInt32 id) |
| void | doInitRegisterGLObject (UInt32 id, UInt32 num) |
| static void | initRegisterGLObject (UInt32 id, UInt32 num) |
| static UInt32 | packIdStatus (UInt32 id, GLObjectStatusE status) |
Field Get | |
|
| |
| SFUInt16 * | editSFWidth (void) |
| Get the Window::_sfWidth field. | |
| const SFUInt16 * | getSFWidth (void) const |
| Get the Window::_sfWidth field. | |
| SFUInt16 * | getSFWidth (void) |
| Get the Window::_sfWidth field. | |
| SFUInt16 * | editSFHeight (void) |
| Get the Window::_sfHeight field. | |
| const SFUInt16 * | getSFHeight (void) const |
| Get the Window::_sfHeight field. | |
| SFUInt16 * | getSFHeight (void) |
| Get the Window::_sfHeight field. | |
| MFViewportPtr * | editMFPort (void) |
| Get the Window::_mfPort field. | |
| const MFViewportPtr * | getMFPort (void) const |
| Get the Window::_mfPort field. | |
| MFViewportPtr * | getMFPort (void) |
| Get the Window::_mfPort field. | |
| SFBool * | editSFResizePending (void) |
| Get the Window::_sfResizePending field. | |
| const SFBool * | getSFResizePending (void) const |
| Get the Window::_sfResizePending field. | |
| SFBool * | getSFResizePending (void) |
| Get the Window::_sfResizePending field. | |
| UInt16 & | editWidth (void) |
| Get the value of the Window::_sfWidth field. | |
| const UInt16 & | getWidth (void) const |
| Get the value of the Window::_sfWidth field. | |
| UInt16 & | getWidth (void) |
| Get the value of the Window::_sfWidth field. | |
| UInt16 & | editHeight (void) |
| Get the value of the Window::_sfHeight field. | |
| const UInt16 & | getHeight (void) const |
| Get the value of the Window::_sfHeight field. | |
| UInt16 & | getHeight (void) |
| Get the value of the Window::_sfHeight field. | |
| bool & | editResizePending (void) |
| Get the value of the Window::_sfResizePending field. | |
| const bool & | getResizePending (void) const |
| Get the value of the Window::_sfResizePending field. | |
| bool & | getResizePending (void) |
| Get the value of the Window::_sfResizePending field. | |
| ViewportPtr & | editPort (const UInt32 index) |
| Get the value of the index element the Window::_mfPort field. | |
| const ViewportPtr & | getPort (const UInt32 index) const |
| Get the value of the index element the Window::_mfPort field. | |
| ViewportPtr & | getPort (const UInt32 index) |
| Get the value of the index element the Window::_mfPort field. | |
| MFViewportPtr & | getPort (void) |
| Get the Window::_mfPort field. | |
| const MFViewportPtr & | getPort (void) const |
| Get the Window::_mfPort field. | |
| SFUInt32 * | editSFGlObjectEventCounter (void) |
| Get the Window::_sfGlObjectEventCounter field. | |
| const SFUInt32 * | getSFGlObjectEventCounter (void) const |
| Get the Window::_sfGlObjectEventCounter field. | |
| SFUInt32 * | getSFGlObjectEventCounter (void) |
| Get the Window::_sfGlObjectEventCounter field. | |
| MFUInt32 * | editMFGlObjectLastRefresh (void) |
| Get the Window::_mfGlObjectLastRefresh field. | |
| const MFUInt32 * | getMFGlObjectLastRefresh (void) const |
| Get the Window::_mfGlObjectLastRefresh field. | |
| MFUInt32 * | getMFGlObjectLastRefresh (void) |
| Get the Window::_mfGlObjectLastRefresh field. | |
| MFUInt32 * | editMFGlObjectLastReinitialize (void) |
| Get the Window::_mfGlObjectLastReinitialize field. | |
| const MFUInt32 * | getMFGlObjectLastReinitialize (void) const |
| Get the Window::_mfGlObjectLastReinitialize field. | |
| MFUInt32 * | getMFGlObjectLastReinitialize (void) |
| Get the Window::_mfGlObjectLastReinitialize field. | |
| UInt32 & | editGlObjectEventCounter (void) |
| Get the value of the Window::_sfGlObjectEventCounter field. | |
| const UInt32 & | getGlObjectEventCounter (void) const |
| Get the value of the Window::_sfGlObjectEventCounter field. | |
| UInt32 & | getGlObjectEventCounter (void) |
| Get the value of the Window::_sfGlObjectEventCounter field. | |
| UInt32 & | editGlObjectLastRefresh (UInt32 index) |
| Get the value of the index element the Window::_mfGlObjectLastRefresh field. | |
| const UInt32 & | getGlObjectLastRefresh (UInt32 index) const |
| Get the value of the index element the Window::_mfGlObjectLastRefresh field. | |
| UInt32 & | getGlObjectLastRefresh (UInt32 index) |
| Get the value of the index element the Window::_mfGlObjectLastRefresh field. | |
| MFUInt32 & | getGlObjectLastRefresh (void) |
| Get the Window::_mfGlObjectLastRefresh field. | |
| const MFUInt32 & | getGlObjectLastRefresh (void) const |
| Get the Window::_mfGlObjectLastRefresh field. | |
| UInt32 & | editGlObjectLastReinitialize (UInt32 index) |
| Get the value of the index element the Window::_mfGlObjectLastReinitialize field. | |
| const UInt32 & | getGlObjectLastReinitialize (UInt32 index) const |
| Get the value of the index element the Window::_mfGlObjectLastReinitialize field. | |
| UInt32 & | getGlObjectLastReinitialize (UInt32 index) |
| Get the value of the index element the Window::_mfGlObjectLastReinitialize field. | |
| MFUInt32 & | getGlObjectLastReinitialize (void) |
| Get the Window::_mfGlObjectLastReinitialize field. | |
| const MFUInt32 & | getGlObjectLastReinitialize (void) const |
| Get the Window::_mfGlObjectLastReinitialize field. | |
Field Set | |
|
| |
| void | setWidth (const UInt16 &value) |
| Set the value of the Window::_sfWidth field. | |
| void | setHeight (const UInt16 &value) |
| Set the value of the Window::_sfHeight field. | |
| void | setResizePending (const bool &value) |
| Set the value of the Window::_sfResizePending field. | |
| void | setGlObjectEventCounter (const UInt32 &value) |
| Set the value of the Window::_sfGlObjectEventCounter field. | |
Definition at line 83 of file OSGWIN32WindowBase.h.
typedef Window osg::WIN32WindowBase::Inherited [private] |
Reimplemented from osg::Window.
Definition at line 87 of file OSGWIN32WindowBase.h.
Reimplemented from osg::WindowBase.
Definition at line 92 of file OSGWIN32WindowBase.h.
typedef ArgsCollector<UInt32> osg::Window::GLObjectFunctorArgs [inherited] |
Definition at line 96 of file OSGWindow.h.
typedef TypedVoidFunctor2Base<PtrCallArg<Window> , GLObjectFunctorArgs> osg::Window::GLObjectFunctor [inherited] |
Definition at line 99 of file OSGWindow.h.
typedef void(* osg::Window::GLExtensionFunction)(void) [inherited] |
Definition at line 101 of file OSGWindow.h.
typedef std::map< GLenum, Vec2f > osg::Window::ConstHash [protected, inherited] |
Definition at line 332 of file OSGWindow.h.
| anonymous enum |
Definition at line 94 of file OSGWIN32WindowBase.h.
00095 { 00096 HwndFieldId = Inherited::NextFieldId, 00097 HdcFieldId = HwndFieldId + 1, 00098 HglrcFieldId = HdcFieldId + 1, 00099 NextFieldId = HglrcFieldId + 1 00100 };
enum osg::Window::GLObjectStatusE [inherited] |
Enumeration values for the status of the GL objects. This is primarily used to signal the object's callback functions what to do. See OpenGL Objects & Extension Handling for a description.
Definition at line 78 of file OSGWindow.h.
00079 { 00080 notused = 1, 00081 initialize, 00082 reinitialize, 00083 initialized, 00084 needrefresh, 00085 destroy, 00086 finaldestroy 00087 };
anonymous enum [inherited] |
Definition at line 89 of file OSGWindow.h.
00089 { invalidExtensionID = 0x7fffffff, invalidFunctionID = 0x7fffffff };
anonymous enum [inherited] |
Definition at line 92 of file OSGWindow.h.
00092 { statusShift = 3, statusMask = 7 };
anonymous enum [inherited] |
| WidthFieldId | |
| HeightFieldId | |
| PortFieldId | |
| ResizePendingFieldId | |
| GlObjectEventCounterFieldId | |
| GlObjectLastRefreshFieldId | |
| GlObjectLastReinitializeFieldId | |
| NextFieldId |
Definition at line 98 of file OSGWindowBase.h.
00099 { 00100 WidthFieldId = Inherited::NextFieldId, 00101 HeightFieldId = WidthFieldId + 1, 00102 PortFieldId = HeightFieldId + 1, 00103 ResizePendingFieldId = PortFieldId + 1, 00104 GlObjectEventCounterFieldId = ResizePendingFieldId + 1, 00105 GlObjectLastRefreshFieldId = GlObjectEventCounterFieldId + 1, 00106 GlObjectLastReinitializeFieldId = GlObjectLastRefreshFieldId + 1, 00107 NextFieldId = GlObjectLastReinitializeFieldId + 1 00108 };
anonymous enum [inherited] |
Definition at line 78 of file OSGAttachmentContainerImpl.h.
00079 { 00080 AttachmentsFieldId = Inherited::NextFieldId, 00081 NextFieldId = AttachmentsFieldId + 1 00082 };
anonymous enum [inherited] |
Definition at line 73 of file OSGFieldContainerImpl.h.
00073 { NextFieldId = 1 };
| osg::WIN32WindowBase::WIN32WindowBase | ( | void | ) | [protected] |
| osg::WIN32WindowBase::WIN32WindowBase | ( | const WIN32WindowBase & | source | ) | [protected] |
| osg::WIN32WindowBase::~WIN32WindowBase | ( | void | ) | [protected, virtual] |
Definition at line 209 of file OSGWIN32WindowBase.cpp.
| osg::FieldContainerType & osg::WIN32WindowBase::getClassType | ( | void | ) | [inline, static] |
Reimplemented from osg::WindowBase.
Definition at line 58 of file OSGWIN32WindowBase.inl.
References _type.
Referenced by create().
00059 { 00060 return _type; 00061 }
| osg::UInt32 osg::WIN32WindowBase::getClassTypeId | ( | void | ) | [inline, static] |
Reimplemented from osg::WindowBase.
Definition at line 65 of file OSGWIN32WindowBase.inl.
References _type, and osg::TypeBase::getId().
00066 { 00067 return _type.getId(); 00068 }
| FieldContainerType & osg::WIN32WindowBase::getType | ( | void | ) | [virtual] |
Reimplemented from osg::WindowBase.
Definition at line 128 of file OSGWIN32WindowBase.cpp.
References _type.
00129 { 00130 return _type; 00131 }
| const FieldContainerType & osg::WIN32WindowBase::getType | ( | void | ) | const [virtual] |
Reimplemented from osg::WindowBase.
Definition at line 133 of file OSGWIN32WindowBase.cpp.
References _type.
00134 { 00135 return _type; 00136 }
| UInt32 osg::WIN32WindowBase::getContainerSize | ( | void | ) | const [virtual] |
Reimplemented from osg::WindowBase.
Definition at line 148 of file OSGWIN32WindowBase.cpp.
| SFHWND * osg::WIN32WindowBase::editSFHwnd | ( | void | ) | [inline] |
Definition at line 108 of file OSGWIN32WindowBase.inl.
References _sfHwnd.
00109 { 00110 return &_sfHwnd; 00111 }
| const SFHWND * osg::WIN32WindowBase::getSFHwnd | ( | void | ) | const [inline] |
Definition at line 101 of file OSGWIN32WindowBase.inl.
References _sfHwnd.
00102 { 00103 return &_sfHwnd; 00104 }
| SFHWND * osg::WIN32WindowBase::getSFHwnd | ( | void | ) | [inline] |
Definition at line 116 of file OSGWIN32WindowBase.inl.
References _sfHwnd.
00117 { 00118 return &_sfHwnd; 00119 }
| SFHDC * osg::WIN32WindowBase::editSFHdc | ( | void | ) | [inline] |
Definition at line 131 of file OSGWIN32WindowBase.inl.
References _sfHdc.
00132 { 00133 return &_sfHdc; 00134 }
| const SFHDC * osg::WIN32WindowBase::getSFHdc | ( | void | ) | const [inline] |
Definition at line 124 of file OSGWIN32WindowBase.inl.
References _sfHdc.
00125 { 00126 return &_sfHdc; 00127 }
| SFHDC * osg::WIN32WindowBase::getSFHdc | ( | void | ) | [inline] |
Definition at line 139 of file OSGWIN32WindowBase.inl.
References _sfHdc.
00140 { 00141 return &_sfHdc; 00142 }
| SFHGLRC * osg::WIN32WindowBase::editSFHglrc | ( | void | ) | [inline] |
Definition at line 154 of file OSGWIN32WindowBase.inl.
References _sfHglrc.
00155 { 00156 return &_sfHglrc; 00157 }
| const SFHGLRC * osg::WIN32WindowBase::getSFHglrc | ( | void | ) | const [inline] |
Definition at line 147 of file OSGWIN32WindowBase.inl.
References _sfHglrc.
00148 { 00149 return &_sfHglrc; 00150 }
| SFHGLRC * osg::WIN32WindowBase::getSFHglrc | ( | void | ) | [inline] |
Definition at line 162 of file OSGWIN32WindowBase.inl.
References _sfHglrc.
00163 { 00164 return &_sfHglrc; 00165 }
| HWND & osg::WIN32WindowBase::editHwnd | ( | void | ) | [inline] |
Definition at line 171 of file OSGWIN32WindowBase.inl.
References _sfHwnd, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00172 { 00173 return _sfHwnd.getValue(); 00174 }
| const HWND & osg::WIN32WindowBase::getHwnd | ( | void | ) | const [inline] |
Definition at line 178 of file OSGWIN32WindowBase.inl.
References _sfHwnd, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00179 { 00180 return _sfHwnd.getValue(); 00181 }
| HWND & osg::WIN32WindowBase::getHwnd | ( | void | ) | [inline] |
Definition at line 186 of file OSGWIN32WindowBase.inl.
References _sfHwnd, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00187 { 00188 return _sfHwnd.getValue(); 00189 }
| HDC & osg::WIN32WindowBase::editHdc | ( | void | ) | [inline] |
Definition at line 201 of file OSGWIN32WindowBase.inl.
References _sfHdc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00202 { 00203 return _sfHdc.getValue(); 00204 }
| const HDC & osg::WIN32WindowBase::getHdc | ( | void | ) | const [inline] |
Definition at line 208 of file OSGWIN32WindowBase.inl.
References _sfHdc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00209 { 00210 return _sfHdc.getValue(); 00211 }
| HDC & osg::WIN32WindowBase::getHdc | ( | void | ) | [inline] |
Definition at line 216 of file OSGWIN32WindowBase.inl.
References _sfHdc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00217 { 00218 return _sfHdc.getValue(); 00219 }
| HGLRC & osg::WIN32WindowBase::editHglrc | ( | void | ) | [inline] |
Definition at line 231 of file OSGWIN32WindowBase.inl.
References _sfHglrc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00232 { 00233 return _sfHglrc.getValue(); 00234 }
| const HGLRC & osg::WIN32WindowBase::getHglrc | ( | void | ) | const [inline] |
Definition at line 238 of file OSGWIN32WindowBase.inl.
References _sfHglrc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00239 { 00240 return _sfHglrc.getValue(); 00241 }
| HGLRC & osg::WIN32WindowBase::getHglrc | ( | void | ) | [inline] |
Definition at line 246 of file OSGWIN32WindowBase.inl.
References _sfHglrc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00247 { 00248 return _sfHglrc.getValue(); 00249 }
| void osg::WIN32WindowBase::setHwnd | ( | const HWND & | value | ) | [inline] |
Definition at line 194 of file OSGWIN32WindowBase.inl.
References _sfHwnd, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
| void osg::WIN32WindowBase::setHdc | ( | const HDC & | value | ) | [inline] |
Definition at line 224 of file OSGWIN32WindowBase.inl.
References _sfHdc, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
| void osg::WIN32WindowBase::setHglrc | ( | const HGLRC & | value | ) | [inline] |
Definition at line 254 of file OSGWIN32WindowBase.inl.
References _sfHglrc, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
Reimplemented from osg::WindowBase.
Definition at line 215 of file OSGWIN32WindowBase.cpp.
References _sfHdc, _sfHglrc, _sfHwnd, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::WindowBase::getBinSize(), HdcFieldMask, HglrcFieldMask, HwndFieldMask, and osg::FieldBits::NoField.
00216 { 00217 UInt32 returnValue = Inherited::getBinSize(whichField); 00218 00219 if(FieldBits::NoField != (HwndFieldMask & whichField)) 00220 { 00221 returnValue += _sfHwnd.getBinSize(); 00222 } 00223 00224 if(FieldBits::NoField != (HdcFieldMask & whichField)) 00225 { 00226 returnValue += _sfHdc.getBinSize(); 00227 } 00228 00229 if(FieldBits::NoField != (HglrcFieldMask & whichField)) 00230 { 00231 returnValue += _sfHglrc.getBinSize(); 00232 } 00233 00234 00235 return returnValue; 00236 }
| void osg::WIN32WindowBase::copyToBin | ( | BinaryDataHandler & | pMem, | |
| const BitVector & | whichField | |||
| ) | [virtual] |
Reimplemented from osg::WindowBase.
Definition at line 238 of file OSGWIN32WindowBase.cpp.
References _sfHdc, _sfHglrc, _sfHwnd, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::WindowBase::copyToBin(), HdcFieldMask, HglrcFieldMask, HwndFieldMask, and osg::FieldBits::NoField.
00240 { 00241 Inherited::copyToBin(pMem, whichField); 00242 00243 if(FieldBits::NoField != (HwndFieldMask & whichField)) 00244 { 00245 _sfHwnd.copyToBin(pMem); 00246 } 00247 00248 if(FieldBits::NoField != (HdcFieldMask & whichField)) 00249 { 00250 _sfHdc.copyToBin(pMem); 00251 } 00252 00253 if(FieldBits::NoField != (HglrcFieldMask & whichField)) 00254 { 00255 _sfHglrc.copyToBin(pMem); 00256 } 00257 00258 00259 }
| void osg::WIN32WindowBase::copyFromBin | ( | BinaryDataHandler & | pMem, | |
| const BitVector & | whichField | |||
| ) | [virtual] |
Reimplemented from osg::WindowBase.
Definition at line 261 of file OSGWIN32WindowBase.cpp.
References _sfHdc, _sfHglrc, _sfHwnd, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::WindowBase::copyFromBin(), HdcFieldMask, HglrcFieldMask, HwndFieldMask, and osg::FieldBits::NoField.
00263 { 00264 Inherited::copyFromBin(pMem, whichField); 00265 00266 if(FieldBits::NoField != (HwndFieldMask & whichField)) 00267 { 00268 _sfHwnd.copyFromBin(pMem); 00269 } 00270 00271 if(FieldBits::NoField != (HdcFieldMask & whichField)) 00272 { 00273 _sfHdc.copyFromBin(pMem); 00274 } 00275 00276 if(FieldBits::NoField != (HglrcFieldMask & whichField)) 00277 { 00278 _sfHglrc.copyFromBin(pMem); 00279 } 00280 00281 00282 }
| WIN32WindowPtr osg::WIN32WindowBase::create | ( | void | ) | [inline, static] |
Definition at line 72 of file OSGWIN32WindowBase.inl.
References osg::AttachmentContainerPtr::dcast(), getClassType(), osg::NullFC, and shallowCopy().
00073 { 00074 WIN32WindowPtr fc; 00075 00076 if(getClassType().getPrototype() != OSG::NullFC) 00077 { 00078 fc = WIN32WindowPtr::dcast( 00079 getClassType().getPrototype()-> shallowCopy()); 00080 } 00081 00082 return fc; 00083 }
| WIN32WindowPtr osg::WIN32WindowBase::createEmpty | ( | void | ) | [inline, static] |
Definition at line 87 of file OSGWIN32WindowBase.inl.
References osg::FieldContainer::newPtr().
00088 { 00089 WIN32WindowPtr returnValue; 00090 00091 newPtr(returnValue); 00092 00093 return returnValue; 00094 }
| FieldContainerPtr osg::WIN32WindowBase::shallowCopy | ( | void | ) | const [virtual] |
Implements osg::FieldContainer.
Definition at line 139 of file OSGWIN32WindowBase.cpp.
References osg::FieldContainer::newPtr().
Referenced by create().
00140 { 00141 WIN32WindowPtr returnValue; 00142 00143 newPtr(returnValue, dynamic_cast<const WIN32Window *>(this)); 00144 00145 return returnValue; 00146 }
| void osg::WIN32WindowBase::executeSyncImpl | ( | WIN32WindowBase * | pOther, | |
| const BitVector & | whichField | |||
| ) | [protected] |
Reimplemented from osg::WindowBase.
Definition at line 285 of file OSGWIN32WindowBase.cpp.
References _sfHdc, _sfHglrc, _sfHwnd, osg::WindowBase::executeSyncImpl(), HdcFieldMask, HglrcFieldMask, HwndFieldMask, osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().
Referenced by executeSync().
00287 { 00288 00289 Inherited::executeSyncImpl(pOther, whichField); 00290 00291 if(FieldBits::NoField != (HwndFieldMask & whichField)) 00292 _sfHwnd.syncWith(pOther->_sfHwnd); 00293 00294 if(FieldBits::NoField != (HdcFieldMask & whichField)) 00295 _sfHdc.syncWith(pOther->_sfHdc); 00296 00297 if(FieldBits::NoField != (HglrcFieldMask & whichField)) 00298 _sfHglrc.syncWith(pOther->_sfHglrc); 00299 00300 00301 }
| void osg::WIN32WindowBase::executeSync | ( | FieldContainer & | other, | |
| const BitVector & | whichField | |||
| ) | [protected, virtual] |
Reimplemented from osg::WindowBase.
Definition at line 155 of file OSGWIN32WindowBase.cpp.
References executeSyncImpl().
00157 { 00158 this->executeSyncImpl(static_cast<WIN32WindowBase *>(&other), 00159 whichField); 00160 }
| void osg::WIN32WindowBase::operator= | ( | const WIN32WindowBase & | source | ) | [private] |
Assignment
Reimplemented from osg::Window.
| static const char* osg::Window::getClassname | ( | void | ) | [inline, static, inherited] |
Definition at line 107 of file OSGWindow.h.
react to field changes
Reimplemented from osg::AttachmentContainer.
Reimplemented in osg::ClusterWindow, osg::MultiDisplayWindow, osg::SortFirstWindow, osg::PassiveWindow, osg::XWindow, and osg::QTWindow.
Definition at line 401 of file OSGWindow.cpp.
References osg::AttachmentContainer::changed().
Referenced by osg::XWindow::changed(), osg::PassiveWindow::changed(), and osg::ClusterWindow::changed().
00402 { 00403 Inherited::changed(whichField, origin); 00404 }
| void osg::Window::addPort | ( | const ViewportPtr & | portP | ) | [inherited] |
Definition at line 408 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::back(), osg::beginEditCP(), osg::endEditCP(), osg::NullFC, osg::ViewportBase::ParentFieldMask, and osg::MField< FieldTypeT, fieldNameSpace >::push_back().
00409 { 00410 if(portP != NullFC) 00411 { 00412 _mfPort.push_back(portP); 00413 // CHECK CHECK 00414 // _mfPort.back()->setParent(FieldContainer::getPtr<WindowPtr>(*this)); 00415 00416 beginEditCP(portP, Viewport::ParentFieldMask); 00417 { 00418 _mfPort.back()->setParent(WindowPtr(*this)); 00419 } 00420 endEditCP (portP, Viewport::ParentFieldMask); 00421 } 00422 }
| void osg::Window::insertPort | ( | UInt32 | portIndex, | |
| const ViewportPtr & | portP | |||
| ) | [inherited] |
Definition at line 424 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::beginEditCP(), osg::endEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::insert(), osg::NullFC, and osg::ViewportBase::ParentFieldMask.
00425 { 00426 MFViewportPtr::iterator portIt = _mfPort.begin(); 00427 00428 if(portP != NullFC) 00429 { 00430 portIt += portIndex; 00431 00432 // CHECK CHECK 00433 // (*(_mfPort.insert(portIt, portP)))->setParent( 00434 // FieldContainer::getPtr<WindowPtr>(*this)); 00435 00436 beginEditCP(portP, Viewport::ParentFieldMask); 00437 { 00438 (*(_mfPort.insert(portIt, portP)))->setParent( 00439 WindowPtr(*this)); 00440 } 00441 endEditCP (portP, Viewport::ParentFieldMask); 00442 00443 } 00444 }
| void osg::Window::replacePort | ( | UInt32 | portIndex, | |
| const ViewportPtr & | portP | |||
| ) | [inherited] |
Definition at line 447 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, and osg::NullFC.
00448 { 00449 if(portP != NullFC) 00450 { 00451 _mfPort[portIndex]->setParent(NullFC); 00452 _mfPort[portIndex] = portP; 00453 // CHECK CHECK 00454 // _mfPort.getValue(portIndex)->setParent( 00455 // FieldContainer::getPtr<WindowPtr>(*this)); 00456 _mfPort[portIndex]->setParent( 00457 WindowPtr(*this)); 00458 } 00459 }
| void osg::Window::replacePortBy | ( | const ViewportPtr & | portP, | |
| const ViewportPtr & | newPortP | |||
| ) | [inherited] |
Definition at line 461 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::MField< FieldTypeT, fieldNameSpace >::find(), and osg::NullFC.
00463 { 00464 MFViewportPtr::iterator portIt = _mfPort.find(portP); 00465 00466 if(newportP != NullFC) 00467 { 00468 if(portIt != _mfPort.end()) 00469 { 00470 (*portIt)->setParent(NullFC); 00471 (*portIt) = newportP; 00472 // CHECK CHECK 00473 // (*portIt)->setParent( 00474 // FieldContainer::getPtr<WindowPtr>(*this)); 00475 (*portIt)->setParent( 00476 WindowPtr(*this)); 00477 } 00478 } 00479 }
| void osg::Window::subPort | ( | const ViewportPtr & | portP | ) | [inherited] |
Definition at line 481 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::MField< FieldTypeT, fieldNameSpace >::erase(), osg::MField< FieldTypeT, fieldNameSpace >::find(), and osg::NullFC.
Referenced by osg::Window::subPortByObj().
| void osg::Window::subPort | ( | UInt32 | portIndex | ) | [inherited] |
Definition at line 499 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::MField< FieldTypeT, fieldNameSpace >::erase(), and osg::NullFC.
| void osg::Window::subPortByObj | ( | const ViewportPtr & | portP | ) | [inherited] |
Definition at line 494 of file OSGWindow.cpp.
References osg::Window::subPort().
00495 { 00496 subPort(portP); 00497 }
| void osg::Window::clearPorts | ( | void | ) | [inherited] |
Definition at line 513 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::clear(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::NullFC, and osg::subRefCP().
Register a new OpenGL extension. See OpenGL Extensions for details. Ignores NULL strings.
Definition at line 926 of file OSGWindow.cpp.
References osg::Window::_registeredExtensions, FDEBUG, FPDEBUG, osg::Window::staticAcquire(), and osg::Window::staticRelease().
Referenced by osg::BlendChunk::BlendChunk(), osg::PhongMaterial::createChunkMaterial(), osg::DisplayCalibration::createCMViewports(), osg::DVRIsoShader::DVRIsoShader(), osg::DVRMtexLUTShader::DVRMtexLUTShader(), osg::DVRSimpleLUTShader::DVRSimpleLUTShader(), osg::DVRVolume::DVRVolume(), osg::FBOViewport::FBOViewport(), osg::FragmentProgramChunk::FragmentProgramChunk(), osg::GeoPumpFactory::glextInitFunction(), osg::Particles::Particles(), osg::PhongMaterial::PhongMaterial(), osg::PointChunk::PointChunk(), osg::ProgramChunk::ProgramChunk(), osg::RegisterCombinersChunk::RegisterCombinersChunk(), osg::RenderAction::RenderAction(), osg::SHLChunk::SHLChunk(), osg::SHLParameterChunk::SHLParameterChunk(), osg::Slices::Slices(), osg::TextureChunk::TextureChunk(), and osg::VertexProgramChunk::VertexProgramChunk().
00927 { 00928 FDEBUG(("Window::registerExtension: register '%s': ", s)); 00929 staticAcquire(); 00930 00931 if(s == NULL) 00932 { 00933 staticRelease(); 00934 return TypeTraits<UInt32>::getMax(); 00935 } 00936 00937 std::vector<std::string>::iterator i; 00938 00939 i = std::find(_registeredExtensions.begin(), _registeredExtensions.end(), 00940 s); 00941 00942 if(i < _registeredExtensions.end()) 00943 { 00944 staticRelease(); 00945 FPDEBUG(("reusing id %d\n", i - _registeredExtensions.begin())); 00946 return i - _registeredExtensions.begin(); 00947 } 00948 00949 UInt32 r = _registeredExtensions.size(); 00950 _registeredExtensions.push_back(s); 00951 00952 FPDEBUG(("new id %d\n", r)); 00953 00954 staticRelease(); 00955 return r; 00956 }
| void osg::Window::ignoreExtensions | ( | const Char8 * | s | ) | [static, inherited] |
Register new OpenGL extensions to ignore. See OpenGL Extensions for details.
Definition at line 983 of file OSGWindow.cpp.
References osg::Window::_allWindows, osg::Window::_ignoredExtensions, osg::Window::_registeredExtensions, FDEBUG, FPDEBUG, osg::getCPtr(), osg::Window::staticAcquire(), and osg::Window::staticRelease().
Referenced by osg::Window::frameInit(), and osg::RenderAction::start().
00984 { 00985 FDEBUG(("Window:: Ignoring extensions '%s'\n", s)); 00986 00987 staticAcquire(); 00988 00989 std::back_insert_iterator< std::vector<std::string> > 00990 extension_back_inserter(_ignoredExtensions); 00991 00992 std::string toex(s); 00993 00994 for(string_token_iterator ignit = string_token_iterator(toex, ",. "); 00995 ignit != string_token_iterator(); ++ignit) 00996 { 00997 std::string ignore = *ignit; 00998 00999 FDEBUG(("Ignoring '%s':", ignore.c_str())); 01000 01001 if(std::find(_ignoredExtensions.begin(), 01002 _ignoredExtensions.end(), 01003 ignore.c_str()) != _ignoredExtensions.end()) 01004 { 01005 FPDEBUG((" already ignored.\n")); 01006 continue; 01007 } 01008 01009 _ignoredExtensions.push_back(ignore); 01010 01011 std::vector<std::string>::iterator regit; 01012 01013 // if extension is registered, disable it on all existing Windows 01014 01015 regit = std::find(_registeredExtensions.begin(), 01016 _registeredExtensions.end(), 01017 ignore.c_str()); 01018 01019 Int32 ind = -1; 01020 01021 if(regit != _registeredExtensions.end()) 01022 { 01023 ind = regit - _registeredExtensions.begin(); 01024 FPDEBUG(("(reg as %d)", ind)); 01025 } 01026 01027 // Walk all existing windows and remove the ignored extension 01028 // from the _extensions vector. Disable it if it was a registered one. 01029 01030 std::vector<WindowPtr>::iterator winit; 01031 01032 for(winit = _allWindows.begin(); winit != _allWindows.end(); ++winit) 01033 { 01034 FPDEBUG((" %p:", getCPtr((*winit)))); 01035 01036 std::vector<std::string>::iterator extit; 01037 01038 extit = std::find((*winit)->_extensions.begin(), 01039 (*winit)->_extensions.end(), 01040 ignore.c_str()); 01041 01042 if(extit != (*winit)->_extensions.end()) 01043 { 01044 FPDEBUG((" removed")); 01045 (*winit)->_extensions.erase(extit); 01046 } 01047 else 01048 { 01049 FPDEBUG((" nonsupp")); 01050 } 01051 01052 if(ind >= 0) 01053 { 01054 if((*winit)->_availExtensions.size() > UInt32(ind)) 01055 { 01056 (*winit)->_availExtensions[ind] = false; 01057 FPDEBUG((" disabled")); 01058 } 01059 if((*winit)->_commonExtensions.size() > UInt32(ind)) 01060 { 01061 (*winit)->_commonExtensions[ind] = false; 01062 FPDEBUG((" uncommoned")); 01063 } 01064 } 01065 } 01066 FPDEBUG(("\n")); 01067 } 01068 01069 std::sort(_ignoredExtensions.begin(), _ignoredExtensions.end()); 01070 01071 staticRelease(); 01072 }
| UInt32 osg::Window::registerFunction | ( | const Char8 * | s, | |
| Int32 | ext = -1, |
|||
| UInt32 | version = 0xffff | |||
| ) | [static, inherited] |
Register a new OpenGL extension function. See OpenGL Extensions for details. Ignores NULL strings.
Definition at line 1077 of file OSGWindow.cpp.
References osg::Window::_registeredFunctionExts, osg::Window::_registeredFunctions, osg::Window::_registeredFunctionVersions, FDEBUG, FPDEBUG, osg::Window::staticAcquire(), and osg::Window::staticRelease().
Referenced by osg::BlendChunk::BlendChunk(), osg::DVRIsoShader::DVRIsoShader(), osg::DVRMtexLUTShader::DVRMtexLUTShader(), osg::DVRSimpleLUTShader::DVRSimpleLUTShader(), osg::FBOViewport::FBOViewport(), osg::GeoPumpFactory::glextInitFunction(), glextFuncInit::init(), osg::Particles::Particles(), osg::PointChunk::PointChunk(), osg::ProgramChunk::ProgramChunk(), osg::RegisterCombinersChunk::RegisterCombinersChunk(), osg::RenderAction::RenderAction(), osg::SHLChunk::SHLChunk(), osg::Slices::Slices(), and osg::TextureChunk::TextureChunk().
01079 { 01080 if(s == NULL) 01081 return TypeTraits<UInt32>::getMax(); 01082 01083 FDEBUG(("Window::registerFunction: register '%s': ", s)); 01084 01085 staticAcquire(); 01086 01087 std::vector<std::string>::iterator i; 01088 01089 i = std::find(_registeredFunctions.begin(), _registeredFunctions.end(), 01090 s); 01091 01092 if(i < _registeredFunctions.end()) 01093 { 01094 staticRelease(); 01095 FPDEBUG(("reusing id %d\n", i - _registeredFunctions.begin())); 01096 return i - _registeredFunctions.begin(); 01097 } 01098 01099 UInt32 r=_registeredFunctions.size(); 01100 _registeredFunctions.push_back(s); 01101 _registeredFunctionExts.push_back(ext); 01102 _registeredFunctionVersions.push_back(version); 01103 01104 FPDEBUG(("new id %d\n", r)); 01105 01106 staticRelease(); 01107 return r; 01108 }
| void osg::Window::registerConstant | ( | GLenum | val | ) | [static, inherited] |
Register a new OpenGL constant. See OpenGL Extensions for details.
Definition at line 1113 of file OSGWindow.cpp.
References osg::Window::_registeredConstants, osg::Window::staticAcquire(), and osg::Window::staticRelease().
Referenced by osg::TextureChunk::TextureChunk().
01114 { 01115 staticAcquire(); 01116 01117 if(std::find(_registeredConstants.begin(), 01118 _registeredConstants.end(), 01119 val) == _registeredConstants.end()) 01120 { 01121 _registeredConstants.push_back(val); 01122 } 01123 01124 staticRelease(); 01125 }
| void osg::Window::setGLLibraryName | ( | const Char8 * | s | ) | [inline, static, inherited] |
Set the library name where to find OpenGL extension functions. This has to be called before the first extension function is accessed, and it's safe to call it before osgInit().
Definition at line 127 of file OSGWindow.inl.
References osg::Window::_glLibraryName.
00128 { 00129 _glLibraryName = s; 00130 }
| UInt32 osg::Window::getGLVersion | ( | void | ) | [inline, inherited] |
Return the version of OpenGL running in the Window in the form 0x<major><major><minor><minor>, e.g. 0x0201 for version 2.1.
Definition at line 135 of file OSGWindow.inl.
References osg::Window::_glVersion.
Referenced by osg::TextureChunk::activate(), osg::TextureChunk::changeFrom(), osg::TextureChunk::deactivate(), osg::TextureChunk::handleGL(), and osg::TextureChunk::handleTexture().
00136 { 00137 return _glVersion; 00138 }
Find the id of a registered extension. Return -1 if extension not registered.
Definition at line 143 of file OSGWindow.inl.
References osg::Window::_registeredExtensions.
00144 { 00145 std::vector<std::string>::iterator it; 00146 00147 it = std::find(_registeredExtensions.begin(), 00148 _registeredExtensions.end(), 00149 s); 00150 00151 if(it == _registeredExtensions.end()) 00152 return -1; 00153 00154 return Int32(it -_registeredExtensions.begin()); 00155 }
| bool osg::Window::hasExtension | ( | UInt32 | id | ) | [inline, inherited] |
Check if the window has the indicated extension.
Definition at line 63 of file OSGWindow.inl.
References osg::Window::_availExtensions, and FWARNING.
Referenced by osg::TextureChunk::activate(), osg::SHLParameterChunk::activate(), osg::RegisterCombinersChunk::activate(), osg::ProgramChunk::activate(), osg::PointChunk::activate(), osg::DVRSimpleLUTShader::activate(), osg::CubeTextureChunk::activate(), osg::BlendChunk::activate(), osg::DVRIsoShader::activate_NVRegisterCombinerShading(), osg::TextureChunk::changeFrom(), osg::SHLParameterChunk::changeFrom(), osg::ProgramChunk::changeFrom(), osg::PointChunk::changeFrom(), osg::CubeTextureChunk::changeFrom(), osg::BlendChunk::changeFrom(), osg::TextureChunk::deactivate(), osg::ProgramChunk::deactivate(), osg::PointChunk::deactivate(), osg::CubeTextureChunk::deactivate(), osg::BlendChunk::deactivate(), osg::Slices::drawSlices(), GeoPump128(), GeoPump129(), osg::DVRVolume::getTextureMode(), osg::TextureChunk::handleGL(), osg::SHLChunk::handleGL(), osg::ProgramChunk::handleGL(), osg::Geometry::handleGL(), osg::CubeTextureChunk::handleGL(), osg::TextureChunk::handleTexture(), osg::TextureChunk::handleTextureShader(), osg::TextureChunk::hasMultiTexture(), osg::DVRMtexLUTShader::initCombiners(), osg::DVRMtexLUTShader::initialize(), osg::DVRVolume::initializeClipObjects(), osg::DVRSimpleLUTShader::isModeSupported(), osg::DVRIsoShader::isModeSupported(), osg::FBOViewport::render(), osg::DVRMtexLUTShader::renderSlice(), osg::DVRSimpleLUTShader::setupAlphaCorrectionRegisterCombiners(), osg::RenderAction::start(), osg::SHLChunk::updateProgram(), and osg::SHLChunk::updateProgramParameters().
00064 { 00065 if(id >= _availExtensions.size()) 00066 { 00067 FWARNING(("Extension id [%u] out-of-range!\n", id)); 00068 00069 return false; 00070 } 00071 00072 return _availExtensions[id]; 00073 }
| bool osg::Window::hasExtension | ( | const Char8 * | s | ) | [inherited] |
Check if the Window supports the given extension. Should be used for initialisation checks only, for checks done often it's recommended to register the extensions and use hasExtension(UInt32) instead.
Definition at line 962 of file OSGWindow.cpp.
References osg::Window::_extensions, and osg::Window::_ignoredExtensions.
00963 { 00964 if(std::find(_ignoredExtensions.begin(), 00965 _ignoredExtensions.end(), 00966 s) != _ignoredExtensions.end()) 00967 { 00968 return false; 00969 } 00970 00971 if(std::find(_extensions.begin(), 00972 _extensions.end(), 00973 s) != _extensions.end()) 00974 { 00975 return true; 00976 } 00977 00978 return false; 00979 }
| bool osg::Window::hasCommonExtension | ( | UInt32 | id | ) | [inline, static, inherited] |
Check if the window has the indicated extension.
Definition at line 77 of file OSGWindow.inl.
References osg::Window::_commonExtensions.
Referenced by osg::PhongMaterial::createChunkMaterial(), and osg::PhongMaterial::prepareLocalChunks().
00078 { 00079 if(id >= _commonExtensions.size()) 00080 return false; 00081 00082 return _commonExtensions[id]; 00083 }
| Window::GLExtensionFunction osg::Window::getFunction | ( | UInt32 | id | ) | [inline, inherited] |
Get the indicated extension function. The id and the returned functions are checked for sanity and a warning is issued if there are problems. Use getFunctionNoCheck if you're sure you don't need them.
Definition at line 90 of file OSGWindow.inl.
References osg::Window::_extFunctions, osg::Window::_registeredFunctions, and FINFO.
Referenced by osg::SHLChunk::activate(), osg::RegisterCombinersChunk::activate(), osg::ProgramChunk::activate(), osg::PointChunk::activate(), osg::DVRSimpleLUTShader::activate(), osg::BlendChunk::activate(), osg::DVRIsoShader::activate_NVRegisterCombinerShading(), osg::TextureChunk::activeTexture(), osg::FBOViewport::bind(), osg::SHLChunk::changeFrom(), osg::ProgramChunk::changeFrom(), osg::PointChunk::changeFrom(), osg::BlendChunk::changeFrom(), osg::FBOViewport::checkFrameBufferStatus(), osg::GeoVBO::clear(), osg::SHLChunk::deactivate(), osg::ProgramChunk::deactivate(), osg::PointChunk::deactivate(), osg::DVRSimpleLUTShader::deactivate(), osg::BlendChunk::deactivate(), drawShaderStrips< posTrait, secPosTrait, colTrait, texTrait, sizeTrait, normalTrait >::draw(), drawShaderQuads< posTrait, secPosTrait, colTrait, texTrait, sizeTrait, normalTrait >::draw(), osg::GeoVBO::draw(), drawShaderStrips< posTrait, secPosTrait, colTrait, texTrait, sizeTrait, normalTrait >::drawIndexed(), drawShaderQuads< posTrait, secPosTrait, colTrait, texTrait, sizeTrait, normalTrait >::drawIndexed(), osg::Slices::drawSlices(), GeoPump128(), GeoPump129(), osg::SHLChunk::handleGL(), osg::ProgramChunk::handleGL(), osg::TextureChunk::handleTexture(), osg::DVRMtexLUTShader::initCombiners(), osg::DVRIsoShader::initCombiners_Diffuse2Combiners(), osg::DVRIsoShader::initCombiners_DiffuseMultiCombiners(), osg::DVRIsoShader::initCombiners_IsoSurfaceDiffuse(), osg::DVRIsoShader::initCombiners_IsoSurfaceSpecular(), osg::DVRIsoShader::initCombiners_Specular2Combiners(), osg::DVRIsoShader::initCombiners_SpecularMultiCombiners(), osg::FBOViewport::initialize(), osg::FBOViewport::render(), osg::DVRMtexLUTShader::renderSlice(), osg::DVRIsoShader::renderSlice_NVRegisterCombinerShading(), osg::FBOViewport::setTarget(), osg::DVRSimpleLUTShader::setupAlphaCorrectionRegisterCombiners(), osg::DVRIsoShader::setupCombinerParametersDiffuse(), osg::DVRIsoShader::setupCombinerParametersSpecular(), osg::RenderAction::start(), osg::FBOViewport::stop(), osg::GeoVBO::update(), osg::SHLChunk::updateActiveLightsCount(), osg::SHLChunk::updateActiveLightsMask(), osg::SHLChunk::updateCameraOrientation(), osg::SHLChunk::updateCameraPosition(), osg::SHLChunk::updateClusterId(), osg::SHLChunk::updateInvViewMatrix(), osg::SHLChunk::updateInvWorldMatrix(), osg::SHLChunk::updateLight0Active(), osg::SHLChunk::updateLight1Active(), osg::SHLChunk::updateLight2Active(), osg::SHLChunk::updateLight3Active(), osg::SHLChunk::updateLight4Active(), osg::SHLChunk::updateLight5Active(), osg::SHLChunk::updateLight6Active(), osg::SHLChunk::updateLight7Active(), osg::SHLChunk::updateNearFar(), osg::SHLChunk::updateOSGParameters(), osg::SHLChunk::updateParameterLocation(), osg::SHLChunk::updateParameterLocations(), osg::SHLChunk::updateParameters(), osg::SHLChunk::updateProgram(), osg::SHLChunk::updateProgramParameters(), osg::SHLChunk::updateStereoLeftEye(), osg::SHLChunk::updateTransInvWorldMatrix(), osg::SHLChunk::updateViewMatrix(), and osg::SHLChunk::updateWorldMatrix().
00091 { 00092 if(id >= _extFunctions.size()) 00093 { 00094 FINFO(("Window::getFunction: illegal id %d!\n", id)); 00095 return NULL; 00096 } 00097 if(_extFunctions[id] == NULL) 00098 { 00099 FINFO(("Window::getFunction: function \"%s\" is NULL!\n", 00100 _registeredFunctions[id].c_str())); 00101 return NULL; 00102 } 00103 return _extFunctions[id]; 00104 }
| Window::GLExtensionFunction osg::Window::getFunctionNoCheck | ( | UInt32 | id | ) | [inline, inherited] |
Get the indicated extension function.
Definition at line 110 of file OSGWindow.inl.
References osg::Window::_extFunctions.
00111 { 00112 return _extFunctions[ id ]; 00113 }
| void osg::Window::dumpExtensions | ( | void | ) | [inherited] |
Dump all the registered extensions to std::cout.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 1134 of file OSGWindow.cpp.
References osg::Window::_extensions.
01135 { 01136 std::vector<std::string>::iterator it; 01137 std::cout << "GL Extensions: "; 01138 for ( it = _extensions.begin(); it != _extensions.end(); it++ ) 01139 { 01140 std::cout << it->c_str() << ", "; 01141 } 01142 std::cout << std::endl; 01143 }
| osg::Window::GLExtensionFunction osg::Window::getFunctionByName | ( | const Char8 * | s | ) | [inherited] |
Query OpenGL for the pointer to an extension function.
This is called internally when extension functions are first cached.
Reimplemented in osg::ClusterWindow.
Definition at line 1440 of file OSGWindow.cpp.
References osg::Window::_availExtensions, osg::Window::_glLibraryName, osg::Window::_registeredExtensions, FDEBUG, and FWARNING.
Referenced by osg::Window::frameInit().
01442 { 01443 GLExtensionFunction retval = NULL; 01444 01445 #if defined(darwin) 01446 01447 if (NSIsSymbolNameDefined(s)) 01448 { 01449 NSSymbol symbol = NSLookupAndBindSymbol(s); 01450 if (symbol != 0) 01451 retval = GLExtensionFunction(NSAddressOfSymbol(symbol)); 01452 } 01453 01454 #elif defined(WIN32) 01455 01456 retval = (void(__cdecl*)(void)) wglGetProcAddress(s); 01457 01458 #elif defined(__sgi) || defined(darwin) || defined(__hpux) || \ 01459 defined(__linux) || defined(__sun) 01460 01461 /* Workaround for multiple nVidia/Linux installation bugs, based on code by */ 01462 /* Manfred Weiler (Patch 783637) */ 01463 01464 static void (*(*__GetProcAddress)(const GLubyte *))(void) = NULL; 01465 01466 static void *libHandle = NULL; 01467 01468 if(libHandle == NULL) 01469 { 01470 libHandle = dlopen(_glLibraryName, RTLD_NOW | RTLD_LOCAL); 01471 01472 if(!libHandle) 01473 { 01474 FWARNING(("Error in dlopen: %s\n",dlerror())); 01475 abort(); 01476 } 01477 else 01478 { 01479 FDEBUG(("Opened lib %s for GL extension handling.\n", 01480 (_glLibraryName==NULL)?"(executable)":_glLibraryName)); 01481 } 01482 } 01483 01484 if(__GetProcAddress == NULL) 01485 { 01486 __GetProcAddress = 01487 #if __GNUC__ < 4 01488 (void (*(*)(const GLubyte*))()) 01489 #else 01490 reinterpret_cast<void (*(*)(const GLubyte*))()> 01491 #endif 01492 (dlsym(libHandle, "glXGetProcAddressARB")); 01493 01494 if(__GetProcAddress == NULL) 01495 { 01496 __GetProcAddress = 01497 #if __GNUC__ < 4 01498 (void (*(*)(const GLubyte*))()) 01499 #else 01500 reinterpret_cast<void (*(*)(const GLubyte*))()> 01501 #endif 01502 (dlsym(libHandle, "glXGetProcAddress")); 01503 01504 if(__GetProcAddress == NULL) 01505 { 01506 // Couldn't find it linked to the executable. Try to open 01507 // libGL.so directly. 01508 01509 dlclose(libHandle); 01510 01511 libHandle = dlopen("libGL.so", RTLD_NOW | RTLD_GLOBAL); 01512 01513 if(!libHandle) 01514 { 01515 FWARNING(("Error in dlopen: %s\n",dlerror())); 01516 abort(); 01517 } 01518 else 01519 { 01520 FDEBUG(("Opened lib libGL.so for GL extension handling.\n")); 01521 } 01522 01523 __GetProcAddress = 01524 #if __GNUC__ < 4 01525 (void (*(*)(const GLubyte*))()) 01526 #else 01527 reinterpret_cast<void (*(*)(const GLubyte*))()> 01528 #endif 01529 (dlsym(libHandle, "glXGetProcAddressARB")); 01530 01531 if(__GetProcAddress == NULL) 01532 { 01533 __GetProcAddress = 01534 #if __GNUC__ < 4 01535 (void (*(*)(const GLubyte*))()) 01536 #else 01537 reinterpret_cast<void (*(*)(const GLubyte*))()> 01538 #endif 01539 (dlsym(libHandle, "glXGetProcAddress")); 01540 } 01541 01542 if(__GetProcAddress == NULL) 01543 { 01544 FWARNING(("Neither glXGetProcAddress nor " 01545 "glXGetProcAddressARB found! Disabling all " 01546 " extensions for Window %p!\n")); 01547 _availExtensions.clear(); 01548 _availExtensions.resize(_registeredExtensions.size(), false); 01549 } 01550 } 01551 else 01552 { 01553 FDEBUG(("Using glXGetProcAddress for GL extension handling.\n")); 01554 } 01555 } 01556 else 01557 { 01558 FDEBUG(("Using glXGetProcAddressARB for GL extension handling.\n")); 01559 } 01560 } 01561 01562 if(__GetProcAddress != NULL) 01563 { 01564 retval = reinterpret_cast<GLExtensionFunction>( 01565 __GetProcAddress(reinterpret_cast<const GLubyte*>(s))); 01566 } 01567 else 01568 { 01569 retval = 01570 #if __GNUC__ < 4 01571 (GLExtensionFunction) 01572 #else 01573 reinterpret_cast<GLExtensionFunction> 01574 #endif 01575 (dlsym(libHandle, s)); 01576 } 01577 01578 #else 01579 01580 FWARNING(("Window::getFunctionByName: couldn't find implementation!\n" 01581 "Please contact the developers at info@opensg.org.\n")); 01582 retval = NULL; 01583 01584 #endif 01585 01586 if(retval == NULL) 01587 { 01588 FWARNING(("Window::getFunctionByName: Couldn't get function '%s' for " 01589 "Window %p.\n", s, this)); 01590 } 01591 else 01592 { 01593 FDEBUG(("Window::getFunctionByName: got function '%s' for " 01594 "Window %p at %p.\n", s, this, retval)); 01595 } 01596 01597 return retval; 01598 }
| Real32 osg::Window::getConstantValue | ( | GLenum | id | ) | [inline, inherited] |
Return the value of the registered constant, Inf if not registered or no value received yet.
Definition at line 118 of file OSGWindow.inl.
References osg::Window::getConstantValuev().
Referenced by osg::TextureTransformChunk::activate(), osg::TextureChunk::activate(), osg::TexGenChunk::activate(), osg::CubeTextureChunk::activate(), osg::TextureTransformChunk::changeFrom(), osg::TextureChunk::changeFrom(), osg::TexGenChunk::changeFrom(), osg::CubeTextureChunk::changeFrom(), osg::TextureTransformChunk::deactivate(), osg::TextureChunk::deactivate(), osg::TexGenChunk::deactivate(), and osg::CubeTextureChunk::deactivate().
00119 { 00120 return getConstantValuev(id)[0]; 00121 }
| const Vec2f & osg::Window::getConstantValuev | ( | GLenum | id | ) | [inherited] |
Return the value of the registered constant, (Inf, Inf) if not registered or no value received yet.
Definition at line 1604 of file OSGWindow.cpp.
References osg::Window::_availConstants, and osg::Inf.
Referenced by osg::Window::getConstantValue().
01605 { 01606 static Vec2f inf(Inf, Inf); 01607 01608 ConstHash::iterator it = _availConstants.find(id); 01609 01610 if(it != _availConstants.end()) 01611 return _availConstants[id]; 01612 01613 return inf; 01614 }
| const std::vector< std::string > & osg::Window::getRegisteredExtensions | ( | void | ) | [inline, static, inherited] |
Access the registered extensions.
Definition at line 166 of file OSGWindow.inl.
References osg::Window::_registeredExtensions.
00167 { 00168 return _registeredExtensions; 00169 }
| const std::vector< std::string > & osg::Window::getRegisteredFunctions | ( | void | ) | [inline, inherited] |
Access the registered functions.
Definition at line 173 of file OSGWindow.inl.
References osg::Window::_registeredFunctions.
00174 { 00175 return _registeredFunctions; 00176 }
| const std::vector< std::string > & osg::Window::getExtensions | ( | void | ) | [inline, inherited] |
Access the available extensions.
Definition at line 159 of file OSGWindow.inl.
References osg::Window::_extensions.
00160 { 00161 return _extensions; 00162 }
| const std::vector< std::string > & osg::Window::getIgnoredExtensions | ( | void | ) | [inline, inherited] |
Access the ignored extensions.
Definition at line 180 of file OSGWindow.inl.
References osg::Window::_ignoredExtensions.
00181 { 00182 return _ignoredExtensions; 00183 }
| UInt32 osg::Window::registerGLObject | ( | GLObjectFunctor | functor, | |
| UInt32 | num = 1 | |||
| ) | [static, inherited] |
Register a number of OpenGL objects. By default the number is 1, but more can be necessary for things like text. It returns the first id of the contiguous reserved ID block.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 540 of file OSGWindow.cpp.
References osg::Window::_glObjects, osg::Window::GLObject, osg::Window::initRegisterGLObject(), osg::Window::staticAcquire(), and osg::Window::staticRelease().
Referenced by osg::TextureChunk::changed(), osg::SkyBackground::changed(), osg::SHLChunk::changed(), osg::Geometry::changed(), osg::VertexProgramChunk::onCreate(), osg::TextureChunk::onCreate(), osg::Surface::onCreate(), osg::SHLChunk::onCreate(), osg::Geometry::onCreate(), osg::FragmentProgramChunk::onCreate(), and osg::CubeTextureChunk::onCreate().
00541 { 00542 UInt32 id, i; 00543 GLObject *pGLObject; 00544 00545 staticAcquire(); 00546 00547 // reserve index 0, illegal for most OpenGL functions 00548 if(_glObjects.empty()) 00549 _glObjects.push_back( NULL ); 00550 00551 id = _glObjects.size(); 00552 pGLObject = new GLObject(functor); 00553 00554 // does the requested block fit into the capacity? 00555 00556 if(_glObjects.capacity() >= id + num) 00557 { 00558 _glObjects.insert(_glObjects.end(), num, pGLObject ); 00559 00560 initRegisterGLObject(id, num); 00561 00562 staticRelease(); 00563 00564 return id; 00565 } 00566 00567 // doesn't fit, try to find a block in the middle 00568 00569 UInt32 cnt = 0; 00570 00571 // start searching at 1, id 0 is reserved for GL 00572 for(i = 1; i < _glObjects.size(); ++i) 00573 { 00574 if(_glObjects[i] == NULL) 00575 { 00576 if(cnt == 0) 00577 { 00578 id = i; 00579 } 00580 00581 ++cnt; 00582 00583 if(cnt == num) 00584 { 00585 // block of unused entries found ... 00586 00587 while(i >= id) 00588 { 00589 _glObjects[i] = pGLObject; 00590 i = i - 1; 00591 } 00592 00593 initRegisterGLObject(id, num); 00594 00595 staticRelease(); 00596 00597 return id; 00598 } 00599 } 00600 else 00601 { 00602 cnt = 0; 00603 id = 0; 00604 } 00605 } 00606 00607 // no block found, add at the end 00608 00609 if(id > 0) // ok the last entries in the vector were empty 00610 { 00611 // fill the empty slots at the end 00612 i = id + cnt - 1; 00613 while ( i >= id ) 00614 { 00615 _glObjects[i] = pGLObject; 00616 i = i - 1; 00617 } 00618 } 00619 else 00620 { 00621 // we found no empty entries so the new id is the size of the vector. 00622 id = _glObjects.size(); 00623 } 00624 00625 // expand the vector for the rest 00626 for ( i = 1; i <= num - cnt; i++ ) 00627 { 00628 _glObjects.push_back( pGLObject ); 00629 } 00630 00631 initRegisterGLObject(id, num); 00632 00633 staticRelease(); 00634 00635 return id; 00636 }
| void osg::Window::validateGLObject | ( | UInt32 | id | ) | [inherited] |
Validate the given object, i.e. make sure it is up-to-date in the current context.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 644 of file OSGWindow.cpp.
References osg::Window::_glObjects, osg::Window::_lastValidate, osg::WindowBase::_mfGlObjectLastRefresh, osg::WindowBase::_mfGlObjectLastReinitialize, osg::TypedVoidFunctor2Base< CallArgT, ArgsT, SizeTraitsT >::call(), FDEBUG, osg::Window::GLObject::getFunctor(), osg::WindowBase::getGlObjectEventCounter(), osg::Window::GLObject::incRefCounter(), osg::Window::initialize, osg::Window::needrefresh, osg::Window::packIdStatus(), osg::Window::reinitialize, osg::MField< FieldTypeT, fieldNameSpace >::size(), and SWARNING.
Referenced by osg::TextureChunk::activate(), osg::SHLChunk::activate(), osg::ProgramChunk::activate(), osg::CubeTextureChunk::activate(), osg::TextureChunk::changeFrom(), osg::SHLChunk::changeFrom(), osg::ProgramChunk::changeFrom(), osg::CubeTextureChunk::changeFrom(), osg::TextureGrabBackground::clear(), osg::SkyBackground::clear(), osg::TextureGrabForeground::draw(), osg::Surface::drawPrimitives(), osg::Geometry::drawPrimitives(), osg::Geometry::drawVBO(), osg::Geometry::getVboObject(), osg::FBOViewport::render(), osg::SHLChunk::update(), and osg::Window::validateAllGLObjects().
00645 { 00646 if ( id == 0 ) 00647 { 00648 SWARNING << "Window::validateGLObject: id is 0!" << std::endl; 00649 return; 00650 } 00651 00652 GLObject *obj = _glObjects[id]; 00653 00654 if(obj == NULL) 00655 { 00656 SWARNING << "Window::validateGLObject: obj with id " << id << " is NULL!" << std::endl; 00657 return; 00658 } 00659 00660 if(id >= _lastValidate.size()) // can happen if multi-threading 00661 { 00662 _lastValidate.insert(_lastValidate.end(), 00663 id + 1 - _lastValidate.size(), 00664 0); 00665 } 00666 00667 FDEBUG(("Window 0x%p (event %d,ri:%d,rf:%d): " 00668 "Validating object %d: last reinit:%d, last validate:" 00669 "%d last refresh: %d => %s\n", 00670 this, getGlObjectEventCounter(), 00671 _mfGlObjectLastReinitialize.size(), 00672 _mfGlObjectLastRefresh.size(), 00673 id, 00674 (_mfGlObjectLastReinitialize.size() > id)? 00675 _mfGlObjectLastReinitialize[id]:0xffffffff, 00676 _lastValidate[id], 00677 (_mfGlObjectLastRefresh.size() > id)? 00678 _mfGlObjectLastRefresh[id]:0xffffffff, 00679 (_mfGlObjectLastReinitialize[id] == 0)?"init": 00680 ((_mfGlObjectLastReinitialize[id] > _lastValidate[id])?"reinit": 00681 ((_mfGlObjectLastRefresh[id] > _lastValidate[id])?"refresh": 00682 "up-to-date")) 00683 )); 00684 00685 if(_mfGlObjectLastReinitialize[id] == 0) 00686 { 00687 obj->incRefCounter(); 00688 obj->getFunctor().call(this, packIdStatus(id, initialize)); 00689 _mfGlObjectLastReinitialize[id] = 1; 00690 _lastValidate[id] = getGlObjectEventCounter(); 00691 } 00692 else if(_mfGlObjectLastReinitialize[id] > _lastValidate[id]) 00693 { 00694 obj->getFunctor().call(this, packIdStatus(id, reinitialize)); 00695 _lastValidate[id] = getGlObjectEventCounter(); 00696 } 00697 else if(_mfGlObjectLastRefresh[id] > _lastValidate[id]) 00698 { 00699 obj->getFunctor().call(this, packIdStatus(id, needrefresh)); 00700 _lastValidate[id] = getGlObjectEventCounter(); 00701 } 00702 }
| void osg::Window::validateAllGLObjects | ( | void | ) | [inherited] |
Validate all existing GL objects. Use with care, and only if the correct OpenGL context is active.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 711 of file OSGWindow.cpp.
References osg::Window::_glObjects, osg::Window::activate(), osg::Window::frameExit(), osg::Window::frameInit(), and osg::Window::validateGLObject().
00712 { 00713 activate(); 00714 frameInit(); 00715 00716 for (UInt32 i = 1; i < _glObjects.size(); ++i) 00717 validateGLObject(i); 00718 00719 frameExit(); 00720 }
Validate the given object, i.e. make sure it is up-to-date in the current context.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 185 of file OSGWindow.inl.
References osg::Window::_glObjects, osg::Window::_ids, and SWARNING.
Referenced by osg::Geometry::createVBO(), osg::Geometry::destroyVBO(), osg::TextureChunk::handleGL(), osg::SkyBackground::handleGL(), osg::SHLChunk::handleGL(), osg::ProgramChunk::handleGL(), osg::Geometry::handleGL(), osg::CubeTextureChunk::handleGL(), and osg::SHLChunk::updateProgram().
00186 { 00187 if(osgId < _ids.size()) 00188 { 00189 _ids[osgId] = id2; 00190 } 00191 else 00192 { 00193 _ids.resize(_glObjects.size()); 00194 if(osgId < _ids.size()) 00195 _ids[osgId] = id2; 00196 else 00197 SWARNING << "Window::setGLObjectId: id (" << osgId << ") is not valid!" << std::endl; 00198 } 00199 }
Validate the given object, i.e. make sure it is up-to-date in the current context.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 201 of file OSGWindow.inl.
References osg::Window::_ids.
Referenced by osg::TextureChunk::activate(), osg::SHLChunk::activate(), osg::ProgramChunk::activate(), osg::CubeTextureChunk::activate(), osg::TextureChunk::changeFrom(), osg::SHLChunk::changeFrom(), osg::ProgramChunk::changeFrom(), osg::CubeTextureChunk::changeFrom(), osg::TextureGrabBackground::clear(), osg::SkyBackground::clear(), osg::SHLChunk::deactivate(), osg::ProgramChunk::deactivate(), osg::Geometry::destroyVBO(), osg::TextureGrabForeground::draw(), osg::Geometry::drawPrimitives(), osg::Geometry::drawVBO(), osg::Geometry::getVboObject(), osg::TextureChunk::handleGL(), osg::SkyBackground::handleGL(), osg::SHLChunk::handleGL(), osg::ProgramChunk::handleGL(), osg::Geometry::handleGL(), osg::CubeTextureChunk::handleGL(), osg::FBOViewport::render(), osg::SHLChunk::update(), osg::SHLChunk::updateParameterLocations(), osg::SHLChunk::updateParameters(), osg::SHLChunk::updateProgram(), osg::SHLChunk::updateProgramParameters(), and osg::Geometry::updateVBO().
| UInt32 osg::Window::getGLObjectsSize | ( | void | ) | [inline, static, inherited] |
Validate the given object, i.e. make sure it is up-to-date in the current context.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 210 of file OSGWindow.inl.
References osg::Window::_glObjects.
00211 { 00212 return _glObjects.size(); 00213 }
| void osg::Window::refreshGLObject | ( | UInt32 | id | ) | [static, inherited] |
Mark the given object for refresh. The next time it is validated the registered callback function will be called for a refresh action.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 728 of file OSGWindow.cpp.
References osg::Window::_allWindows, osg::beginEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::endEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::getValues(), osg::WindowBase::GlObjectEventCounterFieldMask, osg::WindowBase::GlObjectLastRefreshFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::size(), and SWARNING.
Referenced by osg::Surface::changed(), osg::SkyBackground::changed(), osg::SHLChunk::changed(), osg::ProgramChunk::changed(), osg::Geometry::changed(), osg::Geometry::invalidateDlistCache(), osg::Window::refreshAllGLObjects(), osg::BrickSet::reloadBrickTextures(), and osg::TextureChunk::triggerRefresh().
00729 { 00730 if ( id == 0 ) 00731 { 00732 SWARNING << "Window::refreshGLObject: id is 0!" << std::endl; 00733 return; 00734 } 00735 00736 std::vector<WindowPtr>::iterator it; 00737 00738 for ( it = _allWindows.begin(); it != _allWindows.end(); ++it) 00739 { 00740 beginEditCP(*it, GlObjectEventCounterFieldMask| 00741 GlObjectLastRefreshFieldMask); 00742 00743 UInt32 lastinv = (*it)->getGlObjectEventCounter() + 1; 00744 MFUInt32 &field = (*it)->_mfGlObjectLastRefresh; 00745 if(field.size() <= id) 00746 field.getValues().insert(field.end(), id - field.size() + 1, 0 ); 00747 field[id] = lastinv; 00748 (*it)->setGlObjectEventCounter(lastinv); 00749 00750 endEditCP (*it, GlObjectEventCounterFieldMask| 00751 GlObjectLastRefreshFieldMask); 00752 } 00753 }
| void osg::Window::refreshAllGLObjects | ( | void | ) | [static, inherited] |
Refresh all existing GL objects.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 760 of file OSGWindow.cpp.
References osg::Window::_glObjects, and osg::Window::refreshGLObject().
00761 { 00762 for (UInt32 i = 1; i < _glObjects.size(); ++i) 00763 refreshGLObject(i); 00764 }
| void osg::Window::reinitializeGLObject | ( | UInt32 | id | ) | [static, inherited] |
Mark the given object for reinitialisation. The next time it is validated the registered callback function will be called for a reinit action.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 772 of file OSGWindow.cpp.
References osg::Window::_allWindows, osg::beginEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::endEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::getValues(), osg::WindowBase::GlObjectEventCounterFieldMask, osg::WindowBase::GlObjectLastReinitializeFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::size(), and SWARNING.
Referenced by osg::SHLChunk::changed(), osg::ProgramChunk::changed(), osg::Window::reinitializeAllGLObjects(), and osg::TextureChunk::triggerReInit().
00773 { 00774 if ( id == 0 ) 00775 { 00776 SWARNING << "Window::reinitializeGLObject: id is 0!" << std::endl; 00777 return; 00778 } 00779 00780 std::vector<WindowPtr>::iterator it; 00781 00782 for(it = _allWindows.begin(); it != _allWindows.end(); ++it) 00783 { 00784 beginEditCP(*it, GlObjectEventCounterFieldMask| 00785 GlObjectLastReinitializeFieldMask); 00786 00787 UInt32 lastinv = (*it)->getGlObjectEventCounter() + 1; 00788 00789 MFUInt32 &field = (*it)->_mfGlObjectLastReinitialize; 00790 if(field.size() <= id) 00791 field.getValues().insert(field.end(), id - field.size() + 1, 0 ); 00792 // is it already validated? 00793 if(field[id] == 0) 00794 continue; 00795 field[id] = lastinv; 00796 (*it)->setGlObjectEventCounter(lastinv); 00797 00798 endEditCP (*it, GlObjectEventCounterFieldMask| 00799 GlObjectLastReinitializeFieldMask); 00800 } 00801 }
| void osg::Window::reinitializeAllGLObjects | ( | void | ) | [static, inherited] |
Reinitialize all existing GL objects.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 808 of file OSGWindow.cpp.
References osg::Window::_glObjects, and osg::Window::reinitializeGLObject().
00809 { 00810 for (UInt32 i = 1; i < _glObjects.size(); ++i) 00811 reinitializeGLObject(i); 00812 }
Mark the given objects for destruction. The actual destruction will happen later.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 875 of file OSGWindow.cpp.
References osg::Window::_allWindows, osg::Window::_glObjects, and FWARNING.
Referenced by osg::SkyBackground::changed(), osg::Geometry::changed(), osg::TextureChunk::onDestroy(), osg::Surface::onDestroy(), osg::SkyBackground::onDestroy(), osg::SHLChunk::onDestroy(), osg::Geometry::onDestroy(), and osg::ProgramChunk::~ProgramChunk().
00876 { 00877 #ifdef OSG_DEBUG 00878 if(id >= _glObjects.size() || _glObjects[id] == NULL) 00879 { 00880 FWARNING(("Window::destroyGLObject: object %d is NULL!\n", id)); 00881 return; 00882 } 00883 #endif 00884 00885 // Has this object ever been used? 00886 if(_glObjects[id] && _glObjects[id]->getRefCounter() == 0) 00887 { 00888 if(_glObjects[id]) 00889 delete _glObjects[ id ]; 00890 00891 for ( UInt32 j = 0; j < num ; j++) 00892 { 00893 _glObjects[id+j] = NULL; 00894 } 00895 00896 return; 00897 } 00898 00899 std::vector<WindowPtr>::iterator it; 00900 00901 for(it = _allWindows.begin(); it != _allWindows.end(); ++it) 00902 { 00903 #ifdef OSG_DEBUG 00904 if(id + num > (*it)->_mfGlObjectLastReinitialize.size()) 00905 { 00906 FWARNING(("Window::destroyGLObject: id %d + num %d exceed" 00907 "registered objects size %d!\n", id, num, 00908 (*it)->_mfGlObjectLastReinitialize.size())); 00909 return; 00910 } 00911 #endif 00912 00913 // has the object been used in this context at all? 00914 if((*it)->getGlObjectLastReinitialize(id) != 0) 00915 (*it)->_glObjectDestroyList.push_back(DestroyEntry(id,num)); 00916 } 00917 }
| void osg::Window::unpackIdStatus | ( | UInt32 | idstatus, | |
| UInt32 & | osgId, | |||
| GLObjectStatusE & | status | |||
| ) | [inline, static, inherited] |
Unpack the id and the status from one UInt32 packed by packIdStatus
Definition at line 232 of file OSGWindow.inl.
References osg::Window::statusMask, and osg::Window::statusShift.
Referenced by osg::TextureChunk::handleGL(), osg::Surface::handleGL(), osg::SkyBackground::handleGL(), osg::SHLChunk::handleGL(), osg::ProgramChunk::handleGL(), osg::Geometry::handleGL(), osg::CubeTextureChunk::handleGL(), and osg::ProgramChunk::printCompileError().
00234 { 00235 osgId = idstatus >> statusShift; 00236 status = static_cast<GLObjectStatusE>(idstatus & statusMask); 00237 }
| bool osg::Window::isResizePending | ( | void | ) | [inline, inherited] |
Definition at line 56 of file OSGWindow.inl.
References osg::WindowBase::_sfResizePending, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
Referenced by osg::Window::resizeGL().
00057 { 00058 return _sfResizePending.getValue(); 00059 }
| void osg::Window::resize | ( | int | width, | |
| int | height | |||
| ) | [virtual, inherited] |
Resize notifier function.
As OpenSG does not do Window System event management it needs to be notified whenever the size of a Window changes.
Definition at line 1741 of file OSGWindow.cpp.
References osg::beginEditCP(), osg::endEditCP(), osg::WindowBase::HeightFieldMask, osg::WindowBase::ResizePendingFieldMask, osg::WindowBase::setHeight(), osg::WindowBase::setResizePending(), osg::WindowBase::setWidth(), and osg::WindowBase::WidthFieldMask.
01742 { 01743 WindowPtr win(*this); 01744 beginEditCP(win, WidthFieldMask|HeightFieldMask|ResizePendingFieldMask); 01745 setWidth( width ); 01746 setHeight( height ); 01747 setResizePending( true ); 01748 endEditCP (win, WidthFieldMask|HeightFieldMask|ResizePendingFieldMask); 01749 }
| void osg::Window::resizeGL | ( | void | ) | [virtual, inherited] |
Resize function.
This function needs to be called before a Window's Viewports are rendered, to ensure that eventual pending resizes are handled correctly.
Definition at line 1757 of file OSGWindow.cpp.
References osg::beginEditCP(), osg::endEditCP(), osg::WindowBase::getHeight(), osg::WindowBase::getWidth(), osg::Window::isResizePending(), osg::WindowBase::ResizePendingFieldMask, and osg::WindowBase::setResizePending().
Referenced by osg::Window::draw(), osg::FBOViewport::render(), and osg::RenderAction::start().
01758 { 01759 if ( isResizePending () ) 01760 { 01761 glViewport( 0, 0, getWidth(), getHeight() ); 01762 WindowPtr win(*this); 01763 beginEditCP(win, ResizePendingFieldMask); 01764 setResizePending( false ); 01765 endEditCP (win, ResizePendingFieldMask); 01766 } 01767 }
Set the width and height of the Window. Only use if you really know what you're doing. In most cases resize() is a better choice.
Definition at line 50 of file OSGWindow.inl.
References osg::WindowBase::setHeight(), and osg::WindowBase::setWidth().
Referenced by osg::SortFirstWindow::clientPreSync().
| void osg::Window::frameInit | ( | void | ) | [virtual, inherited] |
Do everything that needs to be done before the Window is redrawn. This function has to be called for every frame the Window is drawn.
The convenience functions render and draw take care of it, if they are used.
The main task currently is checking and updating OpenGL extensions.
Reimplemented in osg::ClusterWindow.
Definition at line 1156 of file OSGWindow.cpp.
References osg::Window::_availConstants, osg::Window::_availExtensions, osg::Window::_commonExtensions, osg::Window::_extensions, osg::Window::_extFunctions, osg::Window::_glVersion, osg::Window::_ignoredExtensions, osg::Window::_numAvailConstants, osg::Window::_registeredConstants, osg::Window::_registeredExtensions, osg::Window::_registeredFunctionExts, osg::Window::_registeredFunctions, osg::Window::_registeredFunctionVersions, FDEBUG, FFATAL, FLOG, FPDEBUG, FWARNING, osg::Window::getFunctionByName(), osg::Point< ValueTypeT, SizeI >::getValues(), osg::Window::ignoreExtensions(), osg::Window::staticAcquire(), osg::Window::staticRelease(), and osg::Window::unknownConstant.
Referenced by osg::Window::draw(), osg::Window::render(), osg::Window::setupGL(), and osg::Window::validateAllGLObjects().
01157 { 01158 static bool ignoreEnvDone = false; 01159 01160 if(!ignoreEnvDone) 01161 { 01162 ignoreEnvDone = true; 01163 char *p = getenv("OSG_IGNORE_EXTENSIONS"); 01164 if(p) 01165 ignoreExtensions(p); 01166 } 01167 01168 // get version/extensions and split them 01169 if(_extensions.empty()) 01170 { 01171 const char *version = 01172 reinterpret_cast<const char *>(glGetString(GL_VERSION)); 01173 01174 if(version != NULL) 01175 { 01176 int major = atoi(version); 01177 int minor = atoi(strchr(version, '.') + 1); 01178 _glVersion = (major << 8) + minor; 01179 } 01180 else 01181 { 01182 FFATAL(("Window::frameInit: Couldn't detect OpenGL version assuming version 1.1!\n")); 01183 _glVersion = (1 << 8) + 1; 01184 } 01185 01186 #ifdef __APPLE__ 01187 01188 const char* glVendor = (const char*) glGetString(GL_VENDOR); 01189 const char* glRenderer = (const char*) glGetString(GL_RENDERER); 01190 01191 if(glVendor != NULL && glRenderer != NULL) 01192 { 01193 // TODO; is there a better way to switch some 01194 // extentions for a specific os/vendor/renderer combo 01195 FLOG (( "GL Vendor/Renderer: %s/%s\n", glVendor, glRenderer )); 01196 01197 if ( strstr(glVendor, "ATI") && strstr(glRenderer,"X1600") ) 01198 { 01199 FWARNING (("Switch of non_power_of_two for ATI\n")); 01200 ignoreExtensions("GL_ARB_texture_non_power_of_two"); 01201 } 01202 } 01203 01204 #endif // __APPLE 01205 01206 const char *gl_extensions = reinterpret_cast<const char*> (glGetString(GL_EXTENSIONS)); 01207 01208 FDEBUG(("Window %p: GL Version: %4x ('%s')\n", this, 01209 _glVersion, version)); 01210 01211 FDEBUG(("Window %p: GL Extensions: %s\n", this, 01212 gl_extensions)); 01213 01214 std::string foo(gl_extensions != NULL ? gl_extensions : ""); 01215 01216 FDEBUG(("Window %p: Ignored: ", this)); 01217 01218 for(string_token_iterator it = string_token_iterator(foo, ",. "); 01219 it != string_token_iterator(); ++it) 01220 { 01221 if(! std::binary_search(_ignoredExtensions.begin(), 01222 _ignoredExtensions.end(), 01223 *it)) 01224 { 01225 _extensions.push_back(*it); 01226 } 01227 else 01228 { 01229 FPDEBUG(("%s ", (*it).c_str())); 01230 } 01231 } 01232 FPDEBUG(("\n")); 01233 std::sort(_extensions.begin(), _extensions.end()); 01234 01235 // if we don't have any extensions, add something anyway 01236 if(_extensions.empty()) 01237 _availExtensions.resize(_registeredExtensions.size(), false); 01238 } 01239 01240 // any new extension registered ? 01241 if(_registeredExtensions.size() > _availExtensions.size()) 01242 { 01243 staticAcquire(); 01244 FDEBUG(("Window %p: exts: ", this)); 01245 01246 while(_registeredExtensions.size() > _availExtensions.size()) 01247 { 01248 UInt32 s = _availExtensions.size(); 01249 01250 /* perform a binary search over the retrieved extension strings. 01251 Push back the result as an availability flag for the extension 01252 requested by the application */ 01253 bool supported = std::binary_search( 01254 _extensions.begin(), 01255 _extensions.end(), 01256 _registeredExtensions[s]); 01257 01258 /* Is this extension ignored? */ 01259 bool ignored = std::binary_search( 01260 _ignoredExtensions.begin(), 01261 _ignoredExtensions.end(), 01262 _registeredExtensions[s]); 01263 01264 _availExtensions.push_back(supported && !ignored); 01265 01266 FPDEBUG(("%s:", _registeredExtensions[s].c_str())); 01267 if(_commonExtensions.size() <= s) 01268 { 01269 _commonExtensions.push_back(supported && !ignored); 01270 if(supported && !ignored) 01271 { 01272 FPDEBUG(("ok ")); 01273 } 01274 else if(!supported) 01275 { 01276 FPDEBUG(("NF ")); 01277 } 01278 else 01279 { 01280 FPDEBUG(("IGN ")); 01281 } 01282 } 01283 else if (!supported) 01284 { 01285 _commonExtensions[s] = false; 01286 FPDEBUG(("NF ")); 01287 } 01288 else 01289 { 01290 _commonExtensions[s] = false; 01291 FPDEBUG(("IGN ")); 01292 } 01293 } 01294 FPDEBUG(("\n")); 01295 staticRelease(); 01296 } 01297 01298 // any new functions registered ? 01299 while(_registeredFunctions.size() > _extFunctions.size()) 01300 { 01301 const Char8 *s = _registeredFunctions[_extFunctions.size()].c_str(); 01302 Int32 ext = _registeredFunctionExts[_extFunctions.size()]; 01303 UInt32 ver = _registeredFunctionVersions[_extFunctions.size()]; 01304 01305 GLExtensionFunction func = NULL; 01306 01307 if(ext == -1 || _availExtensions[ext] == true || _glVersion >= ver) 01308 func = getFunctionByName(s); 01309 01310 _extFunctions.push_back(func); 01311 } 01312 01313 // any new constants registered ? 01314 while(_registeredConstants.size() > _numAvailConstants) 01315 { 01316 for(std::vector<GLenum>::iterator it = _registeredConstants.begin() + 01317 _numAvailConstants; 01318 it != _registeredConstants.end(); 01319 ++it) 01320 { 01321 Vec2f val(unknownConstant, unknownConstant); 01322 glGetFloatv(*it, static_cast<GLfloat*>(val.getValues())); 01323 _availConstants[*it] = val; 01324 FDEBUG(("Window(%p): Constant 0x%x value is %.3f %.3f\n", this, 01325 *it, val[0], val[1])); 01326 } 01327 _numAvailConstants = _registeredConstants.size(); 01328 glGetError(); // clear the error flag 01329 } 01330 }
| void osg::Window::frameExit | ( | void | ) | [virtual, inherited] |
Do everything that needs to be done after the Window is redrawn. This function has to be called for every frame the Window is drawn.
The convenience functions render and draw take care of it, if they are used.
The main task currently is deleting OpenGL objects.
Reimplemented in osg::ClusterWindow.
Definition at line 1340 of file OSGWindow.cpp.
References osg::Window::_glObjectDestroyList, osg::Window::_glObjects, osg::Window::destroy, FDEBUG, osg::Window::finaldestroy, FWARNING, osg::WindowBase::getGlObjectLastReinitialize(), osg::Window::GLObject::getRefCounter(), and osg::Window::packIdStatus().
Referenced by osg::Window::draw(), osg::Window::render(), and osg::Window::validateAllGLObjects().
01341 { 01342 std::list<DestroyEntry>::iterator st,en; 01343 01344 st = _glObjectDestroyList.begin(); 01345 en = _glObjectDestroyList.end (); 01346 01347 while(st != en) 01348 { 01349 UInt32 i = st->first, n = st->second; 01350 01351 GLObject *obj = _glObjects[ i ]; 01352 01353 if(obj == NULL) 01354 { 01355 FDEBUG(("Window::frameExit: objects %d (%d) already destroyed?!?\n", 01356 i, n)); 01357 ++st; 01358 continue; 01359 } 01360 01361 UInt32 rc = obj->getRefCounter(); 01362 01363 // has the object been used in this context at all? 01364 if(getGlObjectLastReinitialize(i) != 0) 01365 { 01366 _glObjects[i]->getFunctor().call( this, packIdStatus(i, destroy)); 01367 01368 if((rc = _glObjects[ i ]->decRefCounter()) <= 0) 01369 { 01370 // call functor with the final-flag 01371 _glObjects[i]->getFunctor().call( this, 01372 packIdStatus(i, finaldestroy)); 01373 } 01374 } 01375 01376 // if the GLObject is removed from each GL-Context, free GLObject-IDs. 01377 if(rc <= 0) 01378 { 01379 delete _glObjects[ i ]; 01380 for ( UInt32 j = 0; j < n ; j++) 01381 { 01382 _glObjects[i+j] = NULL; 01383 } 01384 } 01385 01386 ++st; 01387 } 01388 01389 _glObjectDestroyList.clear(); 01390 01391 // Test for OpenGL errors. Just a little precaution to catch 01392 // stray errors. This is the only OpenGL error test in opt mode 01393 // and it needs to be enabled using the OSG_TEST_GL_ERRORS envvar. 01394 // In debug mode it is always on. 01395 static bool inited = false; 01396 #ifndef OSG_DEBUG 01397 static bool testGLErrors = false; 01398 #else 01399 static bool testGLErrors = true; 01400 #endif 01401 01402 if(!inited) 01403 { 01404 inited = true; 01405 char *p = getenv("OSG_DEBUG"); 01406 if(p) 01407 testGLErrors = true; 01408 } 01409 01410 if(testGLErrors) 01411 { 01412 GLenum glerr; 01413 01414 while((glerr = glGetError()) != GL_NO_ERROR) 01415 { 01416 FWARNING(("Window::frameExit: Caught stray OpenGL error %s (%#x).\n", 01417 gluErrorString(glerr), 01418 glerr)); 01419 #ifndef OSG_DEBUG 01420 FWARNING(("Rerun with debug-libraries to get more accurate " 01421 "information.\n")); 01422 #endif 01423 } 01424 } 01425 01426 }
| void osg::Window::draw | ( | DrawAction * | action = NULL |
) | [virtual, inherited] |
Draw the Window using the given DrawAction.
It takes care of all initialisation and cleanup functions and contains just 6 lines of code. If you know that the correct context is active or you want to delay swaps you can just copy and manipulate it.
Definition at line 1649 of file OSGWindow.cpp.
References osg::Window::activate(), osg::Window::drawAllViewports(), osg::Window::frameExit(), osg::Window::frameInit(), osg::Window::resizeGL(), and osg::Window::swap().
| void osg::Window::drawAllViewports | ( | DrawAction * | action = NULL |
) | [virtual, inherited] |
Draw all the Viewports of the Window using the given DrawAction.
A simple convenience function that loops all Viewports and call their draw method.
Definition at line 1667 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::DrawActionBase::setWindow(), and SWARNING.
Referenced by osg::Window::draw().
01668 { 01669 MFViewportPtr::iterator portIt = _mfPort.begin(); 01670 MFViewportPtr::const_iterator portEnd = _mfPort.end(); 01671 01672 if(action != NULL) 01673 { 01674 action->setWindow(this); 01675 01676 while(portIt != portEnd) 01677 { 01678 (*portIt)->draw(action); 01679 01680 ++portIt; 01681 } 01682 } 01683 else 01684 { 01685 SWARNING << "Window::drawAllViewports: no action!" << std::endl; 01686 } 01687 }
| void osg::Window::render | ( | RenderActionBase * | action = NULL |
) | [virtual, inherited] |
Render the Window using the given RenderAction.
It takes care of all initialisation and cleanup functions and contains just 5 lines of code. If you know that the correct context is active or you want to delay swaps you can just copy and manipulate it.
Reimplemented in osg::ClusterWindow.
Definition at line 1695 of file OSGWindow.cpp.
References osg::Window::activate(), osg::Window::frameExit(), osg::Window::frameInit(), osg::Window::renderAllViewports(), and osg::Window::swap().
01696 { 01697 activate(); 01698 frameInit(); // query recently registered GL extensions 01699 01700 // resizeGL(); 01701 01702 renderAllViewports(action); 01703 01704 swap(); 01705 frameExit(); // after frame cleanup: delete GL objects, if needed 01706 }
| void osg::Window::renderAllViewports | ( | RenderActionBase * | action = NULL |
) | [virtual, inherited] |
Render all the Viewports of the Window using the given RenderAction.
A simple convenience function that loops all Viewports and call their draw method.
Reimplemented in osg::ClusterWindow.
Definition at line 1714 of file OSGWindow.cpp.
References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::DrawActionBase::setWindow(), and SWARNING.
Referenced by osg::Window::render().
01715 { 01716 MFViewportPtr::iterator portIt = _mfPort.begin(); 01717 MFViewportPtr::const_iterator portEnd = _mfPort.end(); 01718 01719 if(action != NULL) 01720 { 01721 action->setWindow(this); 01722 01723 while(portIt != portEnd) 01724 { 01725 (*portIt)->render(action); 01726 ++portIt; 01727 } 01728 } 01729 else 01730 { 01731 SWARNING << "Window::renderAllViewports: no action!" << std::endl; 01732 } 01733 }
| void osg::Window::init | ( | void | ) | [pure virtual, inherited] |
Initialize the Window and its OpenGL context. This method needs to be called once after the Window has been created and its Window System-specific parameters are set.
It leaves the OpenGL context current to simplify modifying the OpenGL state.
Implemented in osg::ClusterWindow, osg::PassiveWindow, osg::XWindow, and osg::QTWindow.
| void osg::Window::activate | ( | void | ) | [pure virtual, inherited] |
Activate the Window's OpenGL context, so that OpenGL can be called.
Implemented in osg::ClusterWindow, osg::PassiveWindow, and osg::XWindow.
Referenced by osg::Window::draw(), osg::Window::render(), and osg::Window::validateAllGLObjects().
| void osg::Window::deactivate | ( | void | ) | [pure virtual, inherited] |
Deativate the Window's OpenGL context. OpenGL calls are no longer possible after this call.
Implemented in osg::ClusterWindow, osg::PassiveWindow, and osg::XWindow.
| void osg::Window::swap | ( | void | ) | [pure virtual, inherited] |
Swap the back and front buffers.
Implemented in osg::ClusterWindow, osg::PassiveWindow, and osg::XWindow.
Referenced by osg::Window::draw(), and osg::Window::render().
| void osg::Window::dump | ( | UInt32 | uiIndent = 0, |
|
| const BitVector | bvFlags = 0 | |||
| ) | const [virtual, inherited] |
output the instance for debug purposes
Reimplemented from osg::AttachmentContainer.
Reimplemented in osg::ClusterWindow, osg::MultiDisplayWindow, osg::SortFirstWindow, osg::PassiveWindow, osg::XWindow, and osg::QTWindow.
Definition at line 1796 of file OSGWindow.cpp.
References SLOG.
01798 { 01799 SLOG << "Dump Window NI" << std::endl; 01800 }
| void osg::Window::setupGL | ( | void | ) | [protected, virtual, inherited] |
Initialize the OpenGL state OpenSG expects. This should be called once whenever a new Window is opened.
Don't call it directly, call the Window System-specific init() method instead.
Definition at line 1623 of file OSGWindow.cpp.
References osg::Window::frameInit().
Referenced by osg::XWindow::init(), osg::QTWindow::init(), and osg::PassiveWindow::init().
01624 { 01625 glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); 01626 glPixelStorei( GL_PACK_ALIGNMENT, 1 ); 01627 01628 glDepthFunc( GL_LEQUAL ); 01629 glEnable( GL_DEPTH_TEST ); 01630 01631 glEnable( GL_NORMALIZE ); 01632 01633 // switch off default light 01634 GLfloat nul[4]={0,0,0,0}; 01635 glLightfv(GL_LIGHT0, GL_DIFFUSE, nul); 01636 glLightfv(GL_LIGHT0, GL_SPECULAR, nul); 01637 01638 frameInit(); // call it to setup extensions 01639 }
Initialize the GL object registration for the given objects in all Windows.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 820 of file OSGWindow.cpp.
References osg::Window::_allWindows, and SWARNING.
Referenced by osg::Window::registerGLObject().
00821 { 00822 if ( id == 0 ) 00823 { 00824 SWARNING << "Window::initRegisterGLObject: id is 0!" << std::endl; 00825 return; 00826 } 00827 00828 std::vector<WindowPtr>::iterator it; 00829 00830 for(it = _allWindows.begin(); it != _allWindows.end(); ++it) 00831 { 00832 (*it)->doInitRegisterGLObject(id, num); 00833 } 00834 }
| UInt32 osg::Window::packIdStatus | ( | UInt32 | osgId, | |
| GLObjectStatusE | status | |||
| ) | [inline, static, protected, inherited] |
Pack the id and the status into one UInt32. Used to pass the id and status to the actual implementation functions.
Dev:
This packing is not really necessary and just done because I didn't want to change all the prototypes and implementations everywhere. Do it for 1.3.
Definition at line 225 of file OSGWindow.inl.
References osg::Window::statusShift.
Referenced by osg::Window::frameExit(), and osg::Window::validateGLObject().
00226 { 00227 return (osgId << statusShift) | status; 00228 }
Initialize the GL object registration for the given objects in the given Window.
See OpenGL Objects & Extension Handling for a description of the OpenGL object concept.
Definition at line 842 of file OSGWindow.cpp.
References osg::Window::_lastValidate, osg::WindowBase::_mfGlObjectLastRefresh, osg::WindowBase::_mfGlObjectLastReinitialize, osg::beginEditCP(), osg::endEditCP(), osg::WindowBase::GlObjectLastRefreshFieldMask, osg::WindowBase::GlObjectLastReinitializeFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::resize(), and osg::MField< FieldTypeT, fieldNameSpace >::size().
Referenced by osg::Window::operator=(), and osg::Window::Window().
00843 { 00844 WindowPtr win(this); 00845 00846 beginEditCP(win, GlObjectLastReinitializeFieldMask| 00847 GlObjectLastRefreshFieldMask); 00848 00849 if(_mfGlObjectLastReinitialize.size() < id + num) 00850 _mfGlObjectLastReinitialize.resize(id + num); 00851 00852 if(_mfGlObjectLastRefresh.size() < id + num) 00853 _mfGlObjectLastRefresh.resize(id + num); 00854 00855 if(_lastValidate.size() < id + num) 00856 _lastValidate.resize(id + num); 00857 00858 for(UInt32 i = id; i < id + num; ++i) 00859 { 00860 _mfGlObjectLastReinitialize[i] = 0; 00861 _mfGlObjectLastRefresh [i] = 0; 00862 _lastValidate[i] = 0; 00863 } 00864 00865 endEditCP (win, GlObjectLastReinitializeFieldMask| 00866 GlObjectLastRefreshFieldMask); 00867 }
| SFUInt16 * osg::WindowBase::editSFWidth | ( | void | ) | [inline, inherited] |
Definition at line 82 of file OSGWindowBase.inl.
References osg::WindowBase::_sfWidth.
00083 { 00084 return &_sfWidth; 00085 }
| const SFUInt16 * osg::WindowBase::getSFWidth | ( | void | ) | const [inline, inherited] |
Definition at line 75 of file OSGWindowBase.inl.
References osg::WindowBase::_sfWidth.
00076 { 00077 return &_sfWidth; 00078 }
| SFUInt16 * osg::WindowBase::getSFWidth | ( | void | ) | [inline, inherited] |
Definition at line 90 of file OSGWindowBase.inl.
References osg::WindowBase::_sfWidth.
00091 { 00092 return &_sfWidth; 00093 }
| SFUInt16 * osg::WindowBase::editSFHeight | ( | void | ) | [inline, inherited] |
Definition at line 105 of file OSGWindowBase.inl.
References osg::WindowBase::_sfHeight.
00106 { 00107 return &_sfHeight; 00108 }
| const SFUInt16 * osg::WindowBase::getSFHeight | ( | void | ) | const [inline, inherited] |
Definition at line 98 of file OSGWindowBase.inl.
References osg::WindowBase::_sfHeight.
00099 { 00100 return &_sfHeight; 00101 }
| SFUInt16 * osg::WindowBase::getSFHeight | ( | void | ) | [inline, inherited] |
Definition at line 113 of file OSGWindowBase.inl.
References osg::WindowBase::_sfHeight.
00114 { 00115 return &_sfHeight; 00116 }
| MFViewportPtr * osg::WindowBase::editMFPort | ( | void | ) | [inline, inherited] |
Definition at line 128 of file OSGWindowBase.inl.
References osg::WindowBase::_mfPort.
00129 { 00130 return &_mfPort; 00131 }
| const MFViewportPtr * osg::WindowBase::getMFPort | ( | void | ) | const [inline, inherited] |
Definition at line 121 of file OSGWindowBase.inl.
References osg::WindowBase::_mfPort.
Referenced by osg::MultiDisplayWindow::clientInit(), osg::SortFirstWindow::clientPreSync(), osg::SortFirstWindow::clientSwap(), osg::FBOViewport::render(), osg::SortFirstWindow::serverRender(), and osg::MultiDisplayWindow::serverRender().
00122 { 00123 return &_mfPort; 00124 }
| MFViewportPtr * osg::WindowBase::getMFPort | ( | void | ) | [inline, inherited] |
Definition at line 136 of file OSGWindowBase.inl.
References osg::WindowBase::_mfPort.
00137 { 00138 return &_mfPort; 00139 }
| SFBool * osg::WindowBase::editSFResizePending | ( | void | ) | [inline, inherited] |
Definition at line 151 of file OSGWindowBase.inl.
References osg::WindowBase::_sfResizePending.
00152 { 00153 return &_sfResizePending; 00154 }
| const SFBool * osg::WindowBase::getSFResizePending | ( | void | ) | const [inline, inherited] |
Definition at line 144 of file OSGWindowBase.inl.
References osg::WindowBase::_sfResizePending.
00145 { 00146 return &_sfResizePending; 00147 }
| SFBool * osg::WindowBase::getSFResizePending | ( | void | ) | [inline, inherited] |
Definition at line 159 of file OSGWindowBase.inl.
References osg::WindowBase::_sfResizePending.
00160 { 00161 return &_sfResizePending; 00162 }
| UInt16 & osg::WindowBase::editWidth | ( | void | ) | [inline, inherited] |
Definition at line 237 of file OSGWindowBase.inl.
References osg::WindowBase::_sfWidth, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00238 { 00239 return _sfWidth.getValue(); 00240 }
| const UInt16 & osg::WindowBase::getWidth | ( | void | ) | const [inline, inherited] |
Definition at line 244 of file OSGWindowBase.inl.
References osg::WindowBase::_sfWidth, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
Referenced by osg::SortFirstWindow::clientPreSync(), osg::Window::resizeGL(), and osg::MultiDisplayWindow::serverRender().
00245 { 00246 return _sfWidth.getValue(); 00247 }
| UInt16 & osg::WindowBase::getWidth | ( | void | ) | [inline, inherited] |
Definition at line 252 of file OSGWindowBase.inl.
References osg::WindowBase::_sfWidth, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00253 { 00254 return _sfWidth.getValue(); 00255 }
| UInt16 & osg::WindowBase::editHeight | ( | void | ) | [inline, inherited] |
Definition at line 267 of file OSGWindowBase.inl.
References osg::WindowBase::_sfHeight, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00268 { 00269 return _sfHeight.getValue(); 00270 }
| const UInt16 & osg::WindowBase::getHeight | ( | void | ) | const [inline, inherited] |
Definition at line 274 of file OSGWindowBase.inl.
References osg::WindowBase::_sfHeight, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
Referenced by osg::SortFirstWindow::clientPreSync(), osg::Window::resizeGL(), and osg::MultiDisplayWindow::serverRender().
00275 { 00276 return _sfHeight.getValue(); 00277 }
| UInt16 & osg::WindowBase::getHeight | ( | void | ) | [inline, inherited] |
Definition at line 282 of file OSGWindowBase.inl.
References osg::WindowBase::_sfHeight, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00283 { 00284 return _sfHeight.getValue(); 00285 }
| bool & osg::WindowBase::editResizePending | ( | void | ) | [inline, inherited] |
Definition at line 297 of file OSGWindowBase.inl.
References osg::WindowBase::_sfResizePending, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00298 { 00299 return _sfResizePending.getValue(); 00300 }
| const bool & osg::WindowBase::getResizePending | ( | void | ) | const [inline, inherited] |
Definition at line 304 of file OSGWindowBase.inl.
References osg::WindowBase::_sfResizePending, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00305 { 00306 return _sfResizePending.getValue(); 00307 }
| bool & osg::WindowBase::getResizePending | ( | void | ) | [inline, inherited] |
Definition at line 312 of file OSGWindowBase.inl.
References osg::WindowBase::_sfResizePending, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00313 { 00314 return _sfResizePending.getValue(); 00315 }
| ViewportPtr & osg::WindowBase::editPort | ( | const UInt32 | index | ) | [inline, inherited] |
Definition at line 358 of file OSGWindowBase.inl.
References osg::WindowBase::_mfPort.
00359 { 00360 return _mfPort[index]; 00361 }
| const ViewportPtr & osg::WindowBase::getPort | ( | const UInt32 | index | ) | const [inline, inherited] |
Definition at line 365 of file OSGWindowBase.inl.
References osg::WindowBase::_mfPort.
Referenced by osg::FBOViewport::render().
00366 { 00367 return _mfPort[index]; 00368 }
| ViewportPtr & osg::WindowBase::getPort | ( | const UInt32 | index | ) | [inline, inherited] |
Definition at line 373 of file OSGWindowBase.inl.
References osg::WindowBase::_mfPort.
00374 { 00375 return _mfPort[index]; 00376 }
| MFViewportPtr & osg::WindowBase::getPort | ( | void | ) | [inline, inherited] |
Definition at line 380 of file OSGWindowBase.inl.
References osg::WindowBase::_mfPort.
Referenced by osg::MultiDisplayWindow::clientInit(), osg::SortFirstWindow::clientPreSync(), osg::SortFirstWindow::clientSwap(), osg::SortFirstWindow::serverRender(), and osg::MultiDisplayWindow::serverRender().
00381 { 00382 return _mfPort; 00383 }
| const MFViewportPtr & osg::WindowBase::getPort | ( | void | ) | const [inline, inherited] |
Definition at line 387 of file OSGWindowBase.inl.
References osg::WindowBase::_mfPort.
00388 { 00389 return _mfPort; 00390 }
| void osg::WindowBase::setWidth | ( | const UInt16 & | value | ) | [inline, inherited] |
Definition at line 260 of file OSGWindowBase.inl.
References osg::WindowBase::_sfWidth, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
Referenced by osg::Window::operator=(), osg::Window::resize(), osg::MultiDisplayWindow::serverRender(), and osg::Window::setSize().
| void osg::WindowBase::setHeight | ( | const UInt16 & | value | ) | [inline, inherited] |
Definition at line 290 of file OSGWindowBase.inl.
References osg::WindowBase::_sfHeight, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
Referenced by osg::Window::operator=(), osg::Window::resize(), osg::MultiDisplayWindow::serverRender(), and osg::Window::setSize().
| void osg::WindowBase::setResizePending | ( | const bool & | value | ) | [inline, inherited] |
Definition at line 320 of file OSGWindowBase.inl.
References osg::WindowBase::_sfResizePending, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
Referenced by osg::Window::resize(), and osg::Window::resizeGL().
00321 { 00322 _sfResizePending.setValue(value); 00323 }
| SFUInt32 * osg::WindowBase::editSFGlObjectEventCounter | ( | void | ) | [inline, protected, inherited] |
Definition at line 174 of file OSGWindowBase.inl.
References osg::WindowBase::_sfGlObjectEventCounter.
00175 { 00176 return &_sfGlObjectEventCounter; 00177 }
| const SFUInt32 * osg::WindowBase::getSFGlObjectEventCounter | ( | void | ) | const [inline, protected, inherited] |
Definition at line 167 of file OSGWindowBase.inl.
References osg::WindowBase::_sfGlObjectEventCounter.
00168 { 00169 return &_sfGlObjectEventCounter; 00170 }
| SFUInt32 * osg::WindowBase::getSFGlObjectEventCounter | ( | void | ) | [inline, protected, inherited] |
Definition at line 182 of file OSGWindowBase.inl.
References osg::WindowBase::_sfGlObjectEventCounter.
00183 { 00184 return &_sfGlObjectEventCounter; 00185 }
| MFUInt32 * osg::WindowBase::editMFGlObjectLastRefresh | ( | void | ) | [inline, protected, inherited] |
Definition at line 197 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastRefresh.
00198 { 00199 return &_mfGlObjectLastRefresh; 00200 }
| const MFUInt32 * osg::WindowBase::getMFGlObjectLastRefresh | ( | void | ) | const [inline, protected, inherited] |
Definition at line 190 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastRefresh.
00191 { 00192 return &_mfGlObjectLastRefresh; 00193 }
| MFUInt32 * osg::WindowBase::getMFGlObjectLastRefresh | ( | void | ) | [inline, protected, inherited] |
Definition at line 205 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastRefresh.
00206 { 00207 return &_mfGlObjectLastRefresh; 00208 }
| MFUInt32 * osg::WindowBase::editMFGlObjectLastReinitialize | ( | void | ) | [inline, protected, inherited] |
Definition at line 220 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastReinitialize.
00221 { 00222 return &_mfGlObjectLastReinitialize; 00223 }
| const MFUInt32 * osg::WindowBase::getMFGlObjectLastReinitialize | ( | void | ) | const [inline, protected, inherited] |
Definition at line 213 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastReinitialize.
Referenced by osg::Window::onDestroy().
00214 { 00215 return &_mfGlObjectLastReinitialize; 00216 }
| MFUInt32 * osg::WindowBase::getMFGlObjectLastReinitialize | ( | void | ) | [inline, protected, inherited] |
Definition at line 228 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastReinitialize.
00229 { 00230 return &_mfGlObjectLastReinitialize; 00231 }
| UInt32 & osg::WindowBase::editGlObjectEventCounter | ( | void | ) | [inline, protected, inherited] |
Definition at line 327 of file OSGWindowBase.inl.
References osg::WindowBase::_sfGlObjectEventCounter, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00328 { 00329 return _sfGlObjectEventCounter.getValue(); 00330 }
| const UInt32 & osg::WindowBase::getGlObjectEventCounter | ( | void | ) | const [inline, protected, inherited] |
Definition at line 334 of file OSGWindowBase.inl.
References osg::WindowBase::_sfGlObjectEventCounter, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
Referenced by osg::Window::validateGLObject().
00335 { 00336 return _sfGlObjectEventCounter.getValue(); 00337 }
| UInt32 & osg::WindowBase::getGlObjectEventCounter | ( | void | ) | [inline, protected, inherited] |
Definition at line 342 of file OSGWindowBase.inl.
References osg::WindowBase::_sfGlObjectEventCounter, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().
00343 { 00344 return _sfGlObjectEventCounter.getValue(); 00345 }
Definition at line 396 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastRefresh.
00397 { 00398 return _mfGlObjectLastRefresh[index]; 00399 }
| const UInt32 & osg::WindowBase::getGlObjectLastRefresh | ( | UInt32 | index | ) | const [inline, protected, inherited] |
Definition at line 403 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastRefresh.
00404 { 00405 return _mfGlObjectLastRefresh[index]; 00406 }
Definition at line 411 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastRefresh.
00412 { 00413 return _mfGlObjectLastRefresh[index]; 00414 }
| MFUInt32 & osg::WindowBase::getGlObjectLastRefresh | ( | void | ) | [inline, protected, inherited] |
Definition at line 418 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastRefresh.
00419 { 00420 return _mfGlObjectLastRefresh; 00421 }
| const MFUInt32 & osg::WindowBase::getGlObjectLastRefresh | ( | void | ) | const [inline, protected, inherited] |
Definition at line 425 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastRefresh.
00426 { 00427 return _mfGlObjectLastRefresh; 00428 }
| UInt32 & osg::WindowBase::editGlObjectLastReinitialize | ( | UInt32 | index | ) | [inline, protected, inherited] |
Definition at line 434 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastReinitialize.
00435 { 00436 return _mfGlObjectLastReinitialize[index]; 00437 }
| const UInt32 & osg::WindowBase::getGlObjectLastReinitialize | ( | UInt32 | index | ) | const [inline, protected, inherited] |
Definition at line 441 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastReinitialize.
00442 { 00443 return _mfGlObjectLastReinitialize[index]; 00444 }
| UInt32 & osg::WindowBase::getGlObjectLastReinitialize | ( | UInt32 | index | ) | [inline, protected, inherited] |
Definition at line 449 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastReinitialize.
00450 { 00451 return _mfGlObjectLastReinitialize[index]; 00452 }
| MFUInt32 & osg::WindowBase::getGlObjectLastReinitialize | ( | void | ) | [inline, protected, inherited] |
Definition at line 456 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastReinitialize.
Referenced by osg::Window::frameExit(), and osg::Window::onDestroy().
00457 { 00458 return _mfGlObjectLastReinitialize; 00459 }
| const MFUInt32 & osg::WindowBase::getGlObjectLastReinitialize | ( | void | ) | const [inline, protected, inherited] |
Definition at line 463 of file OSGWindowBase.inl.
References osg::WindowBase::_mfGlObjectLastReinitialize.
00464 { 00465 return _mfGlObjectLastReinitialize; 00466 }
| void osg::WindowBase::setGlObjectEventCounter | ( | const UInt32 & | value | ) | [inline, protected, inherited] |
Definition at line 350 of file OSGWindowBase.inl.
References osg::WindowBase::_sfGlObjectEventCounter, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().
00351 { 00352 _sfGlObjectEventCounter.setValue(value); 00353 }
| virtual void osg::FieldContainer::executeSync | ( | FieldContainer & | other, | |
| const BitVector & | whichField | |||
| ) | [protected, pure virtual, inherited] |
Referenced by osg::FieldContainerPtrBase::executeSync().
| void AttachmentContainer::addAttachment | ( | const AttachmentPtr & | fieldContainerP, | |
| UInt16 | binding = 0 | |||
| ) | [inherited] |
Definition at line 84 of file OSGAttachmentContainer.cpp.
References osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::NullFC, and osg::subRefCP().
Referenced by osg::AttachmentContainer::AttachmentContainer(), osg::Node::onCreate(), and osg::Image::setAttachmentField().
00086 { 00087 UInt32 key; 00088 00089 if(fieldContainerP == NullFC) 00090 return; 00091 00092 key = (UInt32 (fieldContainerP->getGroupId()) << 16) | binding; 00093 00094 addRefCP(fieldContainerP); 00095 00096 beginEditCP(fieldContainerP, Attachment::ParentsFieldMask); 00097 { 00098 fieldContainerP->addParent(getPtr()); 00099 } 00100 endEditCP (fieldContainerP, Attachment::ParentsFieldMask); 00101 00102 AttachmentMap::iterator fcI = _attachmentMap.getValue().find(key); 00103 00104 if(fcI != _attachmentMap.getValue().end()) 00105 { 00106 beginEditCP((*fcI).second, Attachment::ParentsFieldMask); 00107 { 00108 (*fcI).second->subParent(getPtr()); 00109 } 00110 endEditCP ((*fcI).second, Attachment::ParentsFieldMask); 00111 00112 subRefCP((*fcI).second); 00113 00114 (*fcI).second = fieldContainerP; 00115 } 00116 else 00117 { 00118 _attachmentMap.getValue()[key] = fieldContainerP; 00119 } 00120 }
| void AttachmentContainer::subAttachment | ( | const AttachmentPtr & | fieldContainerP, | |
| UInt16 | binding = 0 | |||
| ) | [inherited] |
Definition at line 122 of file OSGAttachmentContainer.cpp.
References osg::AttachmentContainer::_attachmentMap, osg::beginEditCP(), osg::endEditCP(), osg::AttachmentContainer::getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, and osg::subRefCP().
00124 { 00125 UInt32 key; 00126 00127 AttachmentMap::iterator fcI; 00128 00129 if(fieldContainerP == NullFC) 00130 return; 00131 00132 key = (UInt32(fieldContainerP->getGroupId()) << 16) | binding; 00133 00134 fcI = _attachmentMap.getValue().find(key); 00135 00136 if(fcI != _attachmentMap.getValue().end()) 00137 { 00138 beginEditCP(fieldContainerP, Attachment::ParentsFieldMask); 00139 { 00140 (*fcI).second->subParent(getPtr()); 00141 } 00142 endEditCP (fieldContainerP, Attachment::ParentsFieldMask); 00143 00144 subRefCP((*fcI).second); 00145 00146 _attachmentMap.getValue().erase(fcI); 00147 } 00148 }
| AttachmentPtr AttachmentContainer::findAttachment | ( | UInt32 | groupId, | |
| UInt16 | binding = 0 | |||
| ) | [inherited] |
Definition at line 150 of file OSGAttachmentContainer.cpp.
References osg::AttachmentContainer::_attachmentMap, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::NullFC.
Referenced by osg::Image::findAttachmentField(), and osg::Image::setAttachmentField().
00152 { 00153 UInt32 key = (UInt32(groupId) << 16) | binding; 00154 00155 AttachmentMap::iterator fcI = _attachmentMap.getValue().find(key); 00156 00157 if(fcI == _attachmentMap.getValue().end()) 00158 { 00159 return NullFC; 00160 } 00161 else 00162 { 00163 return (*fcI).second; 00164 } 00165 }
| AttachmentPtr osg::AttachmentContainer::findAttachment | ( | const FieldContainerType & | type, | |
| UInt16 | binding = 0 | |||
| ) | [inline, inherited] |
Definition at line 57 of file OSGAttachmentContainerImpl.inl.
00060 { 00061 return findAttachment(type.getGroupId(), binding); 00062 }
| SFAttachmentMap * AttachmentContainer::getSFAttachments | ( | void | ) | [inherited] |
Field Access
Definition at line 170 of file OSGAttachmentContainer.cpp.
References osg::AttachmentContainer::_attachmentMap.
00171 { 00172 return &_attachmentMap; 00173 }
| AttachmentContainerPtr AttachmentContainer::getPtr | ( | void | ) | [protected, inherited] |
Definition at line 353 of file OSGAttachmentContainer.cpp.
Referenced by osg::FileGrabForeground::draw(), osg::FBOViewport::render(), osg::AttachmentContainer::subAttachment(), and osg::AttachmentContainer::~AttachmentContainer().
00354 { 00355 return AttachmentContainerPtr(*this); 00356 }
| UInt16 osg::FieldContainer::getClassGroupId | ( | void | ) | [inline, static, inherited] |
Definition at line 71 of file OSGFieldContainerImpl.inl.
References osg::FieldContainer::_type, and osg::FieldContainerType::getGroupId().
00072 { 00073 return _type.getGroupId(); 00074 }
| UInt32 osg::FieldContainer::getTypeId | ( | void | ) | const [inline, inherited] |
Definition at line 77 of file OSGFieldContainerImpl.inl.
References osg::TypeBase::getId(), and osg::FieldContainer::getType().
Referenced by osg::TextureChunk::changeFrom(), and osg::CubeTextureChunk::changeFrom().
00078 { 00079 return getType().getId(); 00080 }
| UInt16 osg::FieldContainer::getGroupId | ( | void | ) | const [inline, inherited] |
Definition at line 83 of file OSGFieldContainerImpl.inl.
References osg::FieldContainerType::getGroupId(), and osg::FieldContainer::getType().
Referenced by osg::Image::setAttachmentField().
00084 { 00085 return getType().getGroupId(); 00086 }
| const Char8 * osg::FieldContainer::getTypeName | ( | void | ) | const [inline, inherited] |
Definition at line 89 of file OSGFieldContainerImpl.inl.
References osg::TypeBase::getCName(), and osg::FieldContainer::getType().
00090 { 00091 return getType().getCName(); 00092 }
Generic Field Access
Definition at line 95 of file OSGFieldContainerImpl.inl.
References osg::FieldDescription::getField(), osg::FieldContainerType::getFieldDescription(), and osg::FieldContainer::getType().
Referenced by osg::QFCItem::expand(), osg::VRMLShapeDesc::getFieldAndDesc(), osg::QFieldViewBase::getFieldPtr(), osg::QFieldEditorBase::getFieldPtr(), osg::getParentsField(), and osg::QFCItem::setup().
00096 { 00097 const FieldDescription *desc = getType().getFieldDescription(fieldId); 00098 00099 return desc ? desc->getField(*this) : NULL; 00100 }
Generic Field Access
Definition at line 103 of file OSGFieldContainerImpl.inl.
References osg::FieldContainerType::findFieldDescription(), osg::FieldDescription::getField(), and osg::FieldContainer::getType().
00104 { 00105 const FieldDescription *desc =getType().findFieldDescription(fieldName); 00106 00107 return desc ? desc->getField(*this) : NULL; 00108 }
| void osg::FieldContainer::newPtr | ( | ObjectPtrT & | result, | |
| const typename ObjectPtrT::StoredObjectType * | prototypeP | |||
| ) | [inline, static, protected, inherited] |
Definition at line 138 of file OSGFieldContainerImpl.inl.
References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().
Referenced by osg::XWindowBase::createEmpty(), createEmpty(), osg::ViewportBase::createEmpty(), osg::VertexProgramChunkBase::createEmpty(), osg::TwoSidedLightingChunkBase::createEmpty(), osg::TransformChunkBase::createEmpty(), osg::TransformBase::createEmpty(), osg::TileCameraDecoratorBase::createEmpty(), osg::TextureTransformChunkBase::createEmpty(), osg::TextureGrabForegroundBase::createEmpty(), osg::TextureGrabBackgroundBase::createEmpty(), osg::TextureChunkBase::createEmpty(), osg::TextureBackgroundBase::createEmpty(), osg::TexGenChunkBase::createEmpty(), osg::SwitchMaterialBase::createEmpty(), osg::SwitchBase::createEmpty(), osg::SurfaceBase::createEmpty(), osg::StringAttributeMapBase::createEmpty(), osg::StereoBufferViewportBase::createEmpty(), osg::StencilChunkBase::createEmpty(), osg::StateSortingGroupBase::createEmpty(), osg::StateBase::createEmpty(), osg::SpotLightBase::createEmpty(), osg::SortFirstWindowBase::createEmpty(), osg::SolidBackgroundBase::createEmpty(), osg::SlicesBase::createEmpty(), osg::SkyBackgroundBase::createEmpty(), osg::SimpleTexturedMaterialBase::createEmpty(), osg::SimpleStatisticsForegroundBase::createEmpty(), osg::SimpleMaterialBase::createEmpty(), osg::SHLParameterChunkBase::createEmpty(), osg::SHLChunkBase::createEmpty(), osg::ShearedStereoCameraDecoratorBase::createEmpty(), osg::ShaderParameterVec4fBase::createEmpty(), osg::ShaderParameterVec3fBase::createEmpty(), osg::ShaderParameterVec2fBase::createEmpty(), osg::ShaderParameterStringBase::createEmpty(), osg::ShaderParameterRealBase::createEmpty(), osg::ShaderParameterMVec4fBase::createEmpty(), osg::ShaderParameterMVec3fBase::createEmpty(), osg::ShaderParameterMVec2fBase::createEmpty(), osg::ShaderParameterMRealBase::createEmpty(), osg::ShaderParameterMMatrixBase::createEmpty(), osg::ShaderParameterMIntBase::createEmpty(), osg::ShaderParameterMatrixBase::createEmpty(), osg::ShaderParameterIntBase::createEmpty(), osg::ShaderParameterBoolBase::createEmpty(), osg::ShadeModelChunkBase::createEmpty(), osg::ScreenGroupBase::createEmpty(), osg::SClipPlaneChunkBase::createEmpty(), osg::ResolutionDisplayFilterBase::createEmpty(), osg::RenderOptionsBase::createEmpty(), osg::RegisterCombinersChunkBase::createEmpty(), osg::QTWindowBase::createEmpty(), osg::ProxyGroupBase::createEmpty(), osg::ProjectionCameraDecoratorBase::createEmpty(), osg::PolygonForegroundBase::createEmpty(), osg::PolygonChunkBase::createEmpty(), osg::PolygonBackgroundBase::createEmpty(), osg::PointLightBase::createEmpty(), osg::PointChunkBase::createEmpty(), osg::PhongMaterialBase::createEmpty(), osg::PerspectiveCameraBase::createEmpty(), osg::PassiveWindowBase::createEmpty(), osg::PassiveViewportBase::createEmpty(), osg::PassiveBackgroundBase::createEmpty(), osg::ParticlesBase::createEmpty(), osg::OrthographicCameraBase::createEmpty(), osg::OffsetCameraDecoratorBase::createEmpty(), osg::OffCenterPerspectiveCameraBase::createEmpty(), osg::MultiSwitchBase::createEmpty(), osg::MultiPassMaterialBase::createEmpty(), osg::MultiDisplayWindowBase::createEmpty(), osg::MatrixCameraDecoratorBase::createEmpty(), osg::MatrixCameraBase::createEmpty(), osg::MaterialPoolBase::createEmpty(), osg::MaterialGroupBase::createEmpty(), osg::MaterialChunkBase::createEmpty(), osg::LogicOpChunkBase::createEmpty(), osg::LineChunkBase::createEmpty(), osg::LightModelChunkBase::createEmpty(), osg::LightEnvBase::createEmpty(), osg::LightChunkBase::createEmpty(), osg::InverseTransformBase::createEmpty(), osg::InlineBase::createEmpty(), osg::ImageForegroundBase::createEmpty(), osg::ImageBase::createEmpty(), osg::ImageBackgroundBase::createEmpty(), osg::GroupBase::createEmpty(), osg::GraphicStatisticsForegroundBase::createEmpty(), osg::GradientBackgroundBase::createEmpty(), osg::GrabForegroundBase::createEmpty(), osg::GLUTWindowBase::createEmpty(), osg::GeometryBase::createEmpty(), osg::FresnelMaterialBase::createEmpty(), osg::FragmentProgramChunkBase::createEmpty(), osg::FogChunkBase::createEmpty(), osg::FogBase::createEmpty(), osg::FileGrabForegroundBase::createEmpty(), osg::FCPtrAttributeMapBase::createEmpty(), osg::FBOViewportBase::createEmpty(), osg::FatBorderChunkBase::createEmpty(), osg::DVRVolumeTextureBase::createEmpty(), osg::DVRVolumeBase::createEmpty(), osg::DVRSimpleShaderBase::createEmpty(), osg::DVRSimpleLUTShaderBase::createEmpty(), osg::DVRMtexLUTShaderBase::createEmpty(), osg::DVRLookupTableBase::createEmpty(), osg::DVRIsoSurfaceBase::createEmpty(), osg::DVRIsoShaderBase::createEmpty(), osg::DVRGeometryBase::createEmpty(), osg::DVRClipObjectsBase::createEmpty(), osg::DVRClipGeometryBase::createEmpty(), osg::DVRAppearanceBase::createEmpty(), osg::DistortionDisplayFilterBase::createEmpty(), osg::DistanceLODBase::createEmpty(), osg::DisplayFilterForegroundBase::createEmpty(), osg::DisplayCalibrationBase::createEmpty(), osg::DirectionalLightBase::createEmpty(), osg::DepthClearBackgroundBase::createEmpty(), osg::DepthChunkBase::createEmpty(), osg::CubeTextureChunkBase::createEmpty(), osg::ComponentTransformBase::createEmpty(), osg::ColorMaskChunkBase::createEmpty(), osg::ColorDisplayFilterBase::createEmpty(), osg::ColorBufferViewportBase::createEmpty(), osg::ClusterWindowBase::createEmpty(), osg::ClipPlaneChunkBase::createEmpty(), osg::ClipPlaneBase::createEmpty(), osg::ChunkMaterialBase::createEmpty(), osg::BlendChunkBase::createEmpty(), osg::BillboardBase::createEmpty(), osg::XWindowBase::shallowCopy(), shallowCopy(), osg::ViewportBase::shallowCopy(), osg::VertexProgramChunkBase::shallowCopy(), osg::TwoSidedLightingChunkBase::shallowCopy(), osg::TransformChunkBase::shallowCopy(), osg::TransformBase::shallowCopy(), osg::TileCameraDecoratorBase::shallowCopy(), osg::TextureTransformChunkBase::shallowCopy(), osg::TextureGrabForegroundBase::shallowCopy(), osg::TextureGrabBackgroundBase::shallowCopy(), osg::TextureChunkBase::shallowCopy(), osg::TextureBackgroundBase::shallowCopy(), osg::TexGenChunkBase::shallowCopy(), osg::SwitchMaterialBase::shallowCopy(), osg::SwitchBase::shallowCopy(), osg::SurfaceBase::shallowCopy(), osg::StringAttributeMapBase::shallowCopy(), osg::StereoBufferViewportBase::shallowCopy(), osg::StencilChunkBase::shallowCopy(), osg::StateSortingGroupBase::shallowCopy(), osg::StateBase::shallowCopy(), osg::SpotLightBase::shallowCopy(), osg::SortFirstWindowBase::shallowCopy(), osg::SolidBackgroundBase::shallowCopy(), osg::SlicesBase::shallowCopy(), osg::SkyBackgroundBase::shallowCopy(), osg::SimpleTexturedMaterialBase::shallowCopy(), osg::SimpleStatisticsForegroundBase::shallowCopy(), osg::SimpleMaterialBase::shallowCopy(), osg::SHLParameterChunkBase::shallowCopy(), osg::SHLChunkBase::shallowCopy(), osg::ShearedStereoCameraDecoratorBase::shallowCopy(), osg::ShaderParameterVec4fBase::shallowCopy(), osg::ShaderParameterVec3fBase::shallowCopy(), osg::ShaderParameterVec2fBase::shallowCopy(), osg::ShaderParameterStringBase::shallowCopy(), osg::ShaderParameterRealBase::shallowCopy(), osg::ShaderParameterMVec4fBase::shallowCopy(), osg::ShaderParameterMVec3fBase::shallowCopy(), osg::ShaderParameterMVec2fBase::shallowCopy(), osg::ShaderParameterMRealBase::shallowCopy(), osg::ShaderParameterMMatrixBase::shallowCopy(), osg::ShaderParameterMIntBase::shallowCopy(), osg::ShaderParameterMatrixBase::shallowCopy(), osg::ShaderParameterIntBase::shallowCopy(), osg::ShaderParameterBoolBase::shallowCopy(), osg::ShadeModelChunkBase::shallowCopy(), osg::ScreenGroupBase::shallowCopy(), osg::SClipPlaneChunkBase::shallowCopy(), osg::ResolutionDisplayFilterBase::shallowCopy(), osg::RenderOptionsBase::shallowCopy(), osg::RegisterCombinersChunkBase::shallowCopy(), osg::QTWindowBase::shallowCopy(), osg::ProxyGroupBase::shallowCopy(), osg::ProjectionCameraDecoratorBase::shallowCopy(), osg::PolygonForegroundBase::shallowCopy(), osg::PolygonChunkBase::shallowCopy(), osg::PolygonBackgroundBase::shallowCopy(), osg::PointLightBase::shallowCopy(), osg::PointChunkBase::shallowCopy(), osg::PhongMaterialBase::shallowCopy(), osg::PerspectiveCameraBase::shallowCopy(), osg::PassiveWindowBase::shallowCopy(), osg::PassiveViewportBase::shallowCopy(), osg::PassiveBackgroundBase::shallowCopy(), osg::ParticlesBase::shallowCopy(), osg::OrthographicCameraBase::shallowCopy(), osg::OffsetCameraDecoratorBase::shallowCopy(), osg::OffCenterPerspectiveCameraBase::shallowCopy(), osg::MultiSwitchBase::shallowCopy(), osg::MultiPassMaterialBase::shallowCopy(), osg::MultiDisplayWindowBase::shallowCopy(), osg::MatrixCameraDecoratorBase::shallowCopy(), osg::MatrixCameraBase::shallowCopy(), osg::MaterialPoolBase::shallowCopy(), osg::MaterialGroupBase::shallowCopy(), osg::MaterialChunkBase::shallowCopy(), osg::LogicOpChunkBase::shallowCopy(), osg::LineChunkBase::shallowCopy(), osg::LightModelChunkBase::shallowCopy(), osg::LightEnvBase::shallowCopy(), osg::LightChunkBase::shallowCopy(), osg::InverseTransformBase::shallowCopy(), osg::InlineBase::shallowCopy(), osg::ImageForegroundBase::shallowCopy(), osg::ImageBase::shallowCopy(), osg::ImageBackgroundBase::shallowCopy(), osg::GroupBase::shallowCopy(), osg::GraphicStatisticsForegroundBase::shallowCopy(), osg::GradientBackgroundBase::shallowCopy(), osg::GrabForegroundBase::shallowCopy(), osg::GLUTWindowBase::shallowCopy(), osg::GeometryBase::shallowCopy(), osg::FresnelMaterialBase::shallowCopy(), osg::FragmentProgramChunkBase::shallowCopy(), osg::FogChunkBase::shallowCopy(), osg::FogBase::shallowCopy(), osg::FileGrabForegroundBase::shallowCopy(), osg::FCPtrAttributeMapBase::shallowCopy(), osg::FBOViewportBase::shallowCopy(), osg::FatBorderChunkBase::shallowCopy(), osg::DVRVolumeTextureBase::shallowCopy(), osg::DVRVolumeBase::shallowCopy(), osg::DVRSimpleShaderBase::shallowCopy(), osg::DVRSimpleLUTShaderBase::shallowCopy(), osg::DVRMtexLUTShaderBase::shallowCopy(), osg::DVRLookupTableBase::shallowCopy(), osg::DVRIsoSurfaceBase::shallowCopy(), osg::DVRIsoShaderBase::shallowCopy(), osg::DVRGeometryBase::shallowCopy(), osg::DVRClipObjectsBase::shallowCopy(), osg::DVRClipGeometryBase::shallowCopy(), osg::DVRAppearanceBase::shallowCopy(), osg::DistortionDisplayFilterBase::shallowCopy(), osg::DistanceLODBase::shallowCopy(), osg::DisplayFilterForegroundBase::shallowCopy(), osg::DisplayCalibrationBase::shallowCopy(), osg::DirectionalLightBase::shallowCopy(), osg::DepthClearBackgroundBase::shallowCopy(), osg::DepthChunkBase::shallowCopy(), osg::CubeTextureChunkBase::shallowCopy(), osg::ComponentTransformBase::shallowCopy(), osg::ColorMaskChunkBase::shallowCopy(), osg::ColorDisplayFilterBase::shallowCopy(), osg::ColorBufferViewportBase::shallowCopy(), osg::ClusterWindowBase::shallowCopy(), osg::ClipPlaneChunkBase::shallowCopy(), osg::ClipPlaneBase::shallowCopy(), osg::ChunkMaterialBase::shallowCopy(), osg::BlendChunkBase::shallowCopy(), and osg::BillboardBase::shallowCopy().
00141 { 00142 typedef typename ObjectPtrT::StoredObjectType ObjectType; 00143 00144 UInt8 *pTmp; 00145 00146 result._containerSize = sizeof(ObjectType); 00147 00148 pTmp = 00149 static_cast<UInt8 *>(operator new( 00150 sizeof(Int32) + // ReferenceCount 00151 sizeof(UInt32) + // ContainerId 00152 sizeof(ObjectType) * ThreadManager::getNumAspects())); 00153 00154 *(reinterpret_cast<Int32 *>(pTmp)) = 0; 00155 00156 pTmp += sizeof(Int32); 00157 00158 result._storeP = (pTmp + sizeof(UInt32)); 00159 00160 #ifdef OSG_DEBUG_FCPTR 00161 result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP); 00162 #endif 00163 00164 *(reinterpret_cast<UInt32 *>(pTmp)) = 00165 FieldContainerFactory::the()->registerFieldContainer(result); 00166 00167 #ifdef OSG_INVALID_PTR_CHECK 00168 result._id = *(reinterpret_cast<UInt32 *>(pTmp)); 00169 #endif 00170 00171 Thread::getCurrentChangeList()->addCreated( 00172 *(reinterpret_cast<UInt32 *>(pTmp))); 00173 00174 pTmp += sizeof(UInt32); 00175 00176 ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp); 00177 00178 for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++) 00179 { 00180 pTmp = 00181 reinterpret_cast<UInt8 *>(new (pTmp) ObjectType(*prototypeP)); 00182 00183 pTmp += sizeof(ObjectType); 00184 } 00185 00186 result->onCreate(prototypeP); 00187 00188 for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++) 00189 { 00190 aObject[i].onCreateAspect(aObject, prototypeP); 00191 } 00192 00193 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM) 00194 00195 fprintf(stderr, "GV_MEM_FC_DBG : (%u) cc (%p|%u)\n", 00196 Thread::getAspect(), 00197 result._storeP, 00198 // ObjectType::getClassType().getCName(), 00199 ObjectType::getClassType().getId()); 00200 #endif 00201 00202 #ifdef OSG_DEBUG_TYPED_FCPTR 00203 result.updateTypedStore(); 00204 #endif 00205 }
| void osg::FieldContainer::newPtr | ( | ObjectPtrT & | result | ) | [inline, static, protected, inherited] |
Definition at line 208 of file OSGFieldContainerImpl.inl.
References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().
00209 { 00210 typedef typename ObjectPtrT::StoredObjectType ObjectType; 00211 00212 UInt8 *pTmp; 00213 00214 result._containerSize = sizeof(ObjectType); 00215 00216 pTmp = 00217 static_cast<UInt8 *>(operator new( 00218 sizeof(Int32) + // ReferenceCount 00219 sizeof(UInt32) + // ContainerId 00220 sizeof(ObjectType) * ThreadManager::getNumAspects())); 00221 00222 *(reinterpret_cast<Int32 *>(pTmp)) = 0; 00223 00224 pTmp += sizeof(Int32); 00225 00226 result._storeP = (pTmp + sizeof(UInt32)); 00227 00228 #ifdef OSG_DEBUG_FCPTR 00229 result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP); 00230 #endif 00231 00232 *(reinterpret_cast<UInt32 *>(pTmp)) = 00233 FieldContainerFactory::the()->registerFieldContainer(result); 00234 00235 #ifdef OSG_INVALID_PTR_CHECK 00236 result._id = *(reinterpret_cast<UInt32 *>(pTmp)); 00237 #endif 00238 00239 Thread::getCurrentChangeList()->addCreated( 00240 *(reinterpret_cast<UInt32 *>(pTmp))); 00241 00242 pTmp += sizeof(UInt32); 00243 00244 ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp); 00245 00246 for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++) 00247 { 00248 pTmp = reinterpret_cast<UInt8 *>(new (pTmp) ObjectType()); 00249 00250 pTmp += sizeof(ObjectType); 00251 } 00252 00253 result->onCreate(); 00254 00255 for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++) 00256 { 00257 aObject[i].onCreateAspect(aObject); 00258 } 00259 00260 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM) 00261 fprintf(stderr, "GV_MEM_FC_DBG : (%u) c (%p|%u)\n", 00262 Thread::getAspect(), 00263 result._storeP, 00264 // ObjectType::getClassType().getCName(), 00265 ObjectType::getClassType().getId()); 00266 #endif 00267 00268 #ifdef OSG_DEBUG_TYPED_FCPTR 00269 result.updateTypedStore(); 00270 #endif 00271 }
| void osg::FieldContainer::beginEditX | ( | const BitVector & | whichField, | |
| FieldTypeT & | field | |||
| ) | [inline, protected, inherited] |
Definition at line 293 of file OSGFieldContainerImpl.inl.
| void osg::FieldContainer::endEditX | ( | const BitVector & | whichField, | |
| FieldTypeT & | field | |||
| ) | [inline, protected, inherited] |
Definition at line 299 of file OSGFieldContainerImpl.inl.
References osg::endEditCP().
00300 { 00301 FieldContainerPtr tmpPtr(this); 00302 endEditCP(tmpPtr, whichField); 00303 }
friend class FieldContainer [friend] |
Reimplemented from osg::Window.
Definition at line 273 of file OSGWIN32WindowBase.h.
friend class GLObject [friend, inherited] |
Definition at line 295 of file OSGWindow.h.
Referenced by osg::Window::registerGLObject().
const osg::BitVector osg::WIN32WindowBase::HwndFieldMask [static] |
(TypeTraits<BitVector>::One << WIN32WindowBase::HwndFieldId)
Definition at line 102 of file OSGWIN32WindowBase.h.
Referenced by copyFromBin(), copyToBin(), executeSyncImpl(), and getBinSize().
const osg::BitVector osg::WIN32WindowBase::HdcFieldMask [static] |
(TypeTraits<BitVector>::One << WIN32WindowBase::HdcFieldId)
Definition at line 103 of file OSGWIN32WindowBase.h.
Referenced by copyFromBin(), copyToBin(), executeSyncImpl(), and getBinSize().
const osg::BitVector osg::WIN32WindowBase::HglrcFieldMask [static] |
(TypeTraits<BitVector>::One << WIN32WindowBase::HglrcFieldId)
Definition at line 104 of file OSGWIN32WindowBase.h.
Referenced by copyFromBin(), copyToBin(), executeSyncImpl(), and getBinSize().
const osg::BitVector osg::WIN32WindowBase::MTInfluenceMask [static] |
(Inherited::MTInfluenceMask) |
(static_cast<BitVector>(0x0) << Inherited::NextFieldId)
Reimplemented from osg::WindowBase.
Definition at line 107 of file OSGWIN32WindowBase.h.
HWND osg::WIN32WindowBase::_sfHwnd [protected] |
Definition at line 219 of file OSGWIN32WindowBase.h.
Referenced by copyFromBin(), copyToBin(), editHwnd(), editSFHwnd(), executeSyncImpl(), getBinSize(), getHwnd(), getSFHwnd(), and setHwnd().
HDC osg::WIN32WindowBase::_sfHdc [protected] |
Definition at line 220 of file OSGWIN32WindowBase.h.
Referenced by copyFromBin(), copyToBin(), editHdc(), editSFHdc(), executeSyncImpl(), getBinSize(), getHdc(), getSFHdc(), and setHdc().
HGLRC osg::WIN32WindowBase::_sfHglrc [protected] |
Definition at line 221 of file OSGWIN32WindowBase.h.
Referenced by copyFromBin(), copyToBin(), editHglrc(), editSFHglrc(), executeSyncImpl(), getBinSize(), getHglrc(), getSFHglrc(), and setHglrc().
FieldDescription * osg::WIN32WindowBase::_desc [static, private] |
{
new FieldDescription(SFHWND::getClassType(),
"hwnd",
HwndFieldId, HwndFieldMask,
true,
reinterpret_cast<FieldAccessMethod>(&WIN32WindowBase::editSFHwnd)),
new FieldDescription(SFHDC::getClassType(),
"hdc",
HdcFieldId, HdcFieldMask,
true,
reinterpret_cast<FieldAccessMethod>(&WIN32WindowBase::editSFHdc)),
new FieldDescription(SFHGLRC::getClassType(),
"hglrc",
HglrcFieldId, HglrcFieldMask,
true,
reinterpret_cast<FieldAccessMethod>(&WIN32WindowBase::editSFHglrc))
}
Reimplemented from osg::WindowBase.
Definition at line 275 of file OSGWIN32WindowBase.h.
FieldContainerType osg::WIN32WindowBase::_type [static, private] |
Reimplemented from osg::WindowBase.
Definition at line 276 of file OSGWIN32WindowBase.h.
Referenced by getClassType(), getClassTypeId(), and getType().
const Real32 osg::Window::unknownConstant = -1e100 [static, inherited] |
Definition at line 94 of file OSGWindow.h.
Referenced by osg::TextureTransformChunk::activate(), osg::TextureChunk::activate(), osg::TexGenChunk::activate(), osg::CubeTextureChunk::activate(), osg::TextureTransformChunk::changeFrom(), osg::TextureChunk::changeFrom(), osg::TexGenChunk::changeFrom(), osg::CubeTextureChunk::changeFrom(), osg::TextureTransformChunk::deactivate(), osg::TextureChunk::deactivate(), osg::TexGenChunk::deactivate(), osg::CubeTextureChunk::deactivate(), and osg::Window::frameInit().
const osg::BitVector osg::WindowBase::WidthFieldMask [static, inherited] |
(TypeTraits<BitVector>::One << WindowBase::WidthFieldId)
Definition at line 110 of file OSGWindowBase.h.
Referenced by osg::SortFirstWindow::clientPreSync(), osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), and osg::Window::resize().
const osg::BitVector osg::WindowBase::HeightFieldMask [static, inherited] |
(TypeTraits<BitVector>::One << WindowBase::HeightFieldId)
Definition at line 111 of file OSGWindowBase.h.
Referenced by osg::SortFirstWindow::clientPreSync(), osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), and osg::Window::resize().
const osg::BitVector osg::WindowBase::PortFieldMask [static, inherited] |
(TypeTraits<BitVector>::One << WindowBase::PortFieldId)
Definition at line 112 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::executeSyncImpl(), and osg::WindowBase::getBinSize().
const osg::BitVector osg::WindowBase::ResizePendingFieldMask [static, inherited] |
(TypeTraits<BitVector>::One << WindowBase::ResizePendingFieldId)
Definition at line 113 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::Window::resize(), and osg::Window::resizeGL().
const osg::BitVector osg::WindowBase::GlObjectEventCounterFieldMask [static, inherited] |
(TypeTraits<BitVector>::One << WindowBase::GlObjectEventCounterFieldId)
Definition at line 114 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::Window::refreshGLObject(), osg::Window::reinitializeGLObject(), and osg::RemoteAspect::RemoteAspect().
const osg::BitVector osg::WindowBase::GlObjectLastRefreshFieldMask [static, inherited] |
(TypeTraits<BitVector>::One << WindowBase::GlObjectLastRefreshFieldId)
Definition at line 115 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::Window::doInitRegisterGLObject(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::Window::refreshGLObject(), and osg::RemoteAspect::RemoteAspect().
const osg::BitVector osg::WindowBase::GlObjectLastReinitializeFieldMask [static, inherited] |
(TypeTraits<BitVector>::One << WindowBase::GlObjectLastReinitializeFieldId)
Definition at line 116 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::Window::doInitRegisterGLObject(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::Window::reinitializeGLObject(), and osg::RemoteAspect::RemoteAspect().
UInt16 osg::WindowBase::_sfWidth [protected, inherited] |
Definition at line 232 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::editSFWidth(), osg::WindowBase::editWidth(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::WindowBase::getSFWidth(), osg::WindowBase::getWidth(), and osg::WindowBase::setWidth().
UInt16 osg::WindowBase::_sfHeight [protected, inherited] |
Definition at line 233 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::editHeight(), osg::WindowBase::editSFHeight(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::WindowBase::getHeight(), osg::WindowBase::getSFHeight(), and osg::WindowBase::setHeight().
ViewportPtr osg::WindowBase::_mfPort [protected, inherited] |
Definition at line 234 of file OSGWindowBase.h.
Referenced by osg::Window::addPort(), osg::Window::clearPorts(), osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::Window::drawAllViewports(), osg::WindowBase::editMFPort(), osg::WindowBase::editPort(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::WindowBase::getMFPort(), osg::WindowBase::getPort(), osg::Window::insertPort(), osg::Window::operator=(), osg::Window::renderAllViewports(), osg::Window::replacePort(), osg::Window::replacePortBy(), and osg::Window::subPort().
bool osg::WindowBase::_sfResizePending [protected, inherited] |
Definition at line 235 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::editResizePending(), osg::WindowBase::editSFResizePending(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::WindowBase::getResizePending(), osg::WindowBase::getSFResizePending(), osg::Window::isResizePending(), and osg::WindowBase::setResizePending().
UInt32 osg::WindowBase::_sfGlObjectEventCounter [protected, inherited] |
Counter for GL object events. Needed for multi-aspect updates. Is used in glObjectLastRefresh and glObjectLastReinitialize.
Definition at line 236 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::WindowBase::editGlObjectEventCounter(), osg::WindowBase::editSFGlObjectEventCounter(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::WindowBase::getGlObjectEventCounter(), osg::WindowBase::getSFGlObjectEventCounter(), and osg::WindowBase::setGlObjectEventCounter().
UInt32 osg::WindowBase::_mfGlObjectLastRefresh [protected, inherited] |
indicates the last refresh for the GL object
Definition at line 237 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::Window::doInitRegisterGLObject(), osg::WindowBase::editGlObjectLastRefresh(), osg::WindowBase::editMFGlObjectLastRefresh(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::WindowBase::getGlObjectLastRefresh(), osg::WindowBase::getMFGlObjectLastRefresh(), and osg::Window::validateGLObject().
UInt32 osg::WindowBase::_mfGlObjectLastReinitialize [protected, inherited] |
indicates the last reinit for the GL object
Definition at line 238 of file OSGWindowBase.h.
Referenced by osg::WindowBase::copyFromBin(), osg::WindowBase::copyToBin(), osg::Window::doInitRegisterGLObject(), osg::WindowBase::editGlObjectLastReinitialize(), osg::WindowBase::editMFGlObjectLastReinitialize(), osg::WindowBase::executeSyncImpl(), osg::WindowBase::getBinSize(), osg::WindowBase::getGlObjectLastReinitialize(), osg::WindowBase::getMFGlObjectLastReinitialize(), and osg::Window::validateGLObject().
const BitVector AttachmentContainer::AttachmentsFieldMask [static, inherited] |
(TypeTraits<BitVector>::One <<
AttachmentContainer::AttachmentsFieldId)
Definition at line 84 of file OSGAttachmentContainerImpl.h.
Referenced by osg::VRMLFile::beginNode(), osg::AttachmentContainer::changed(), osg::AttachmentContainer::copyFromBin(), osg::AttachmentContainer::copyToBin(), osg::deepCloneAttachments(), osg::VRMLAppearanceDesc::endNode(), osg::AttachmentContainer::executeSyncImpl(), and osg::AttachmentContainer::getBinSize().
SFAttachmentMap osg::AttachmentContainer::_attachmentMap [protected, inherited] |
Definition at line 161 of file OSGAttachmentContainerImpl.h.
Referenced by osg::AttachmentContainer::AttachmentContainer(), osg::AttachmentContainer::changed(), osg::AttachmentContainer::copyFromBin(), osg::AttachmentContainer::copyToBin(), osg::NodeCore::dump(), osg::Node::dump(), osg::Geometry::dump(), osg::AttachmentContainer::dump(), osg::AttachmentContainer::executeSyncImpl(), osg::AttachmentContainer::findAttachment(), osg::AttachmentContainer::getBinSize(), osg::AttachmentContainer::getSFAttachments(), osg::Node::onCreate(), osg::AttachmentContainer::subAttachment(), and osg::AttachmentContainer::~AttachmentContainer().
const BitVector osg::FieldContainer::NextFieldMask [static, inherited] |
(TypeTraits<BitVector>::One << NextFieldId)
Definition at line 75 of file OSGFieldContainerImpl.h.
const bool osg::FieldContainer::isNodeCore = false [static, inherited] |
Reimplemented in osg::NodeCore.
Definition at line 181 of file OSGFieldContainerImpl.h.
UInt32 osg::FieldContainer::_shares [protected, inherited] |
Definition at line 199 of file OSGFieldContainerImpl.h.
1.6.1