#include <OSGXWindow.h>
Inheritance diagram for osg::XWindow:

Window system implementation functions | |
| *virtual void | init (void) |
| virtual void | activate (void) |
| virtual void | deactivate (void) |
| virtual void | swap (void) |
Extension handling | |
| bool | hasExtension (UInt32 id) |
| bool | hasExtension (const Char8 *s) |
| void * | getFunction (UInt32 id) |
| void * | 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) |
| *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) |
GL object handling | |
| *void | validateGLObject (UInt32 id) |
| void | validateAllGLObjects (void) |
| GLObjectStatusE | getGLObjectStatus (UInt32 id) |
| void | setGLObjectId (UInt32 id, UInt32 id2) |
| UInt32 | getGLObjectId (UInt32 id) |
| static void | refreshGLObject (UInt32 id) |
| static void | reinitializeGLObject (UInt32 id) |
| static void | destroyGLObject (UInt32 id, UInt32 num=1) |
| static void | unpackIdStatus (UInt32 idstatus, UInt32 &id, GLObjectStatusE &status) |
Sync | |
| *void | executeSyncImpl (XWindowBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
GL object handling | |
| void | doInitRegisterGLObject (UInt32 id, UInt32 num) |
| *static void | initRegisterGLObject (UInt32 id, UInt32 num) |
| static UInt32 | packIdStatus (UInt32 id, GLObjectStatusE status) |
Public Types | |
| typedef XWindowPtr | Ptr |
| enum | { DisplayFieldId = Inherited::NextFieldId, WindowFieldId = DisplayFieldId + 1, ContextFieldId = WindowFieldId + 1, NextFieldId = ContextFieldId + 1 } |
| typedef ArgsCollector< UInt32 > | GLObjectFunctorArgs |
| typedef TypedVoidFunctor2Base< PtrCallArg< Window >, GLObjectFunctorArgs > | GLObjectFunctor |
| typedef void(* | GLExtensionFunction )(void) |
| enum | GLObjectStatusE { notused = 1, initialize, reinitialize, initialized, needrefresh, destroy, finaldestroy } |
| enum | { statusShift = 3, statusMask = 7 } |
Public Member Functions | |
Sync | |
| *virtual void | changed (BitVector whichField, UInt32 origin) |
| react to field changes | |
Output | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
| output the instance for debug purposes | |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
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 |
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 XWindowPtr | create (void) |
| create a new instance of the class | |
| static XWindowPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Static Public Attributes | |
| static const osg::BitVector | DisplayFieldMask |
| static const osg::BitVector | WindowFieldMask |
| static const osg::BitVector | ContextFieldMask |
| 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 |
Protected Member Functions | |
Constructors | |
| * | XWindow (void) |
| Constructor. | |
| XWindow (const XWindow &source) | |
| Copy Constructor. | |
Destructors | |
| *virtual | ~XWindow (void) |
| Destructor. | |
Private Types | |
| typedef XWindowBase | Inherited |
Private Member Functions | |
| void | operator= (const XWindow &source) |
Static Private Member Functions | |
| static void | initMethod (void) |
| initialize the static features of the class, e.g. action callbacks | |
Friends | |
| class | FieldContainer |
| class | XWindowBase |
Definition at line 53 of file OSGXWindow.h.
|
|
Reimplemented from osg::XWindowBase. Reimplemented in osg::QTWindow, and osg::QTWindowBase. Definition at line 57 of file OSGXWindow.h. |
|
|
Reimplemented from osg::WindowBase. Definition at line 92 of file OSGXWindowBase.h. |
|
|
Definition at line 96 of file OSGWindow.h. |
|
|
Definition at line 99 of file OSGWindow.h. |
|
|
Definition at line 101 of file OSGWindow.h. |
|
|
Reimplemented from osg::Window. Definition at line 94 of file OSGXWindowBase.h. 00095 { 00096 DisplayFieldId = Inherited::NextFieldId, 00097 WindowFieldId = DisplayFieldId + 1, 00098 ContextFieldId = WindowFieldId + 1, 00099 NextFieldId = ContextFieldId + 1 00100 };
|
|
|
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 };
|
|
|
Definition at line 92 of file OSGWindow.h. 00092 { statusShift = 3, statusMask = 7 };
|
|
|
Definition at line 64 of file OSGXWindow.cpp. 00064 : 00065 Inherited() 00066 { 00067 }
|
|
|
Definition at line 71 of file OSGXWindow.cpp. 00071 : 00072 Inherited(source) 00073 { 00074 }
|
|
|
Definition at line 78 of file OSGXWindow.cpp.
|
|
||||||||||||
|
Reimplemented from osg::Window. Reimplemented in osg::QTWindow. Definition at line 92 of file OSGXWindow.cpp. References osg::Window::changed(). Referenced by osg::QTWindow::changed(). 00093 { 00094 Inherited::changed(whichField, origin); 00095 }
|
|
|
Init the window: create the context and setup the OpenGL. Implements osg::Window. Reimplemented in osg::QTWindow. Definition at line 109 of file OSGXWindow.cpp. References osg::beginEditCP(), osg::XWindowBase::ContextFieldMask, osg::endEditCP(), osg::XWindowBase::getContext(), osg::XWindowBase::getDisplay(), osg::XWindowBase::getWindow(), osg::AccessFlags::None, osg::XWindowBase::setContext(), osg::XWindowBase::setDisplay(), osg::Window::setupGL(), and SFATAL. 00110 { 00111 XVisualInfo *vi, visInfo; 00112 XWindowAttributes winAttr; 00113 00114 XGetWindowAttributes(getDisplay(), getWindow(), &winAttr); 00115 00116 // get the existing glWidget's visual-id 00117 memset(&visInfo, 0, sizeof(XVisualInfo)); 00118 visInfo.visualid = XVisualIDFromVisual(winAttr.visual); 00119 00120 // get new display-variable 00121 if(getDisplay() == NULL) 00122 { 00123 setDisplay(XOpenDisplay(DisplayString(getDisplay()))); 00124 } 00125 00126 // get a visual for the glx context 00127 int nvis; 00128 vi = XGetVisualInfo(getDisplay(), VisualIDMask, &visInfo, &nvis); 00129 00130 // is the visual GL-capable ? 00131 int useGL; 00132 glXGetConfig(getDisplay(), 00133 vi, 00134 GLX_USE_GL, 00135 &useGL ); 00136 if (!useGL) 00137 { 00138 SFATAL << "Visual is not OpenGL-capable!" << std::endl; 00139 } 00140 00141 XWindowPtr win(*this); 00142 beginEditCP(win, ContextFieldMask); 00143 // create the new context 00144 setContext(glXCreateContext(getDisplay(), vi, None, GL_TRUE)); 00145 endEditCP (win, ContextFieldMask); 00146 00147 glXMakeCurrent(getDisplay(), getWindow(), getContext()); 00148 setupGL(); 00149 }
|
|
|
Init the window: create the context and setup the OpenGL. Implements osg::Window. Definition at line 152 of file OSGXWindow.cpp. References osg::XWindowBase::getContext(), osg::XWindowBase::getDisplay(), and osg::XWindowBase::getWindow(). Referenced by osg::QTWindow::init(). 00153 { 00154 glXMakeCurrent(getDisplay(), getWindow(), getContext()); 00155 }
|
|
|
Init the window: create the context and setup the OpenGL. Implements osg::Window. Definition at line 158 of file OSGXWindow.cpp. References osg::XWindowBase::getDisplay(), and osg::AccessFlags::None. 00159 { 00160 glXMakeCurrent(getDisplay(), None, NULL); 00161 }
|
|
|
Init the window: create the context and setup the OpenGL. Implements osg::Window. Definition at line 164 of file OSGXWindow.cpp. References osg::XWindowBase::getDisplay(), and osg::XWindowBase::getWindow(). 00165 { 00166 glXSwapBuffers(getDisplay(), getWindow()); 00167 }
|
|
||||||||||||
|
Reimplemented from osg::Window. Reimplemented in osg::QTWindow. Definition at line 99 of file OSGXWindow.cpp. References SLOG. 00101 { 00102 SLOG << "Dump XWindow NI" << std::endl; 00103 }
|
|
|
Reimplemented from osg::Window. Reimplemented in osg::QTWindow. Definition at line 86 of file OSGXWindow.cpp.
|
|
|
|
|
|
Reimplemented from osg::WindowBase. Reimplemented in osg::QTWindowBase. Definition at line 58 of file OSGXWindowBase.inl. References osg::XWindowBase::_type. Referenced by osg::XWindowBase::create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::WindowBase. Reimplemented in osg::QTWindowBase. Definition at line 65 of file OSGXWindowBase.inl. References osg::XWindowBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::WindowBase. Reimplemented in osg::QTWindowBase. Definition at line 128 of file OSGXWindowBase.cpp. References osg::XWindowBase::_type. 00129 { 00130 return _type; 00131 }
|
|
|
Reimplemented from osg::WindowBase. Reimplemented in osg::QTWindowBase. Definition at line 133 of file OSGXWindowBase.cpp. References osg::XWindowBase::_type. 00134 { 00135 return _type; 00136 }
|
|
|
Reimplemented from osg::WindowBase. Reimplemented in osg::QTWindowBase. Definition at line 148 of file OSGXWindowBase.cpp. 00149 { 00150 return sizeof(XWindow); 00151 }
|
|
|
Definition at line 101 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfDisplay. 00102 { 00103 return &_sfDisplay; 00104 }
|
|
|
Definition at line 108 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfWindow. 00109 { 00110 return &_sfWindow; 00111 }
|
|
|
Definition at line 115 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfContext. 00116 { 00117 return &_sfContext; 00118 }
|
|
|
Definition at line 123 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfDisplay, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by activate(), deactivate(), init(), osg::QTWindow::init(), and swap(). 00124 { 00125 return _sfDisplay.getValue(); 00126 }
|
|
|
Definition at line 130 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfDisplay, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00131 { 00132 return _sfDisplay.getValue(); 00133 }
|
|
|
Definition at line 144 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfWindow, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by activate(), init(), and swap(). 00145 { 00146 return _sfWindow.getValue(); 00147 }
|
|
|
Definition at line 151 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfWindow, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00152 { 00153 return _sfWindow.getValue(); 00154 }
|
|
|
Definition at line 165 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfContext, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by activate(), and init(). 00166 { 00167 return _sfContext.getValue(); 00168 }
|
|
|
Definition at line 172 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfContext, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00173 { 00174 return _sfContext.getValue(); 00175 }
|
|
|
Definition at line 137 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfDisplay, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). Referenced by init(), and osg::QTWindow::init(). 00138 { 00139 _sfDisplay.setValue(value); 00140 }
|
|
|
Definition at line 158 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfWindow, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). Referenced by osg::QTWindow::init().
|
|
|
Definition at line 179 of file OSGXWindowBase.inl. References osg::XWindowBase::_sfContext, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). Referenced by init(), and osg::QTWindow::init(). 00180 { 00181 _sfContext.setValue(value); 00182 }
|
|
|
||||||||||||
|
Reimplemented from osg::WindowBase. Reimplemented in osg::QTWindowBase. Definition at line 237 of file OSGXWindowBase.cpp. References osg::XWindowBase::_sfContext, osg::XWindowBase::_sfDisplay, osg::XWindowBase::_sfWindow, osg::XWindowBase::ContextFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::WindowBase::copyToBin(), osg::XWindowBase::DisplayFieldMask, osg::FieldBits::NoField, and osg::XWindowBase::WindowFieldMask. Referenced by osg::QTWindowBase::copyToBin(). 00239 { 00240 Inherited::copyToBin(pMem, whichField); 00241 00242 if(FieldBits::NoField != (DisplayFieldMask & whichField)) 00243 { 00244 _sfDisplay.copyToBin(pMem); 00245 } 00246 00247 if(FieldBits::NoField != (WindowFieldMask & whichField)) 00248 { 00249 _sfWindow.copyToBin(pMem); 00250 } 00251 00252 if(FieldBits::NoField != (ContextFieldMask & whichField)) 00253 { 00254 _sfContext.copyToBin(pMem); 00255 } 00256 00257 00258 }
|
|
||||||||||||
|
Reimplemented from osg::WindowBase. Reimplemented in osg::QTWindowBase. Definition at line 260 of file OSGXWindowBase.cpp. References osg::XWindowBase::_sfContext, osg::XWindowBase::_sfDisplay, osg::XWindowBase::_sfWindow, osg::XWindowBase::ContextFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::WindowBase::copyFromBin(), osg::XWindowBase::DisplayFieldMask, osg::FieldBits::NoField, and osg::XWindowBase::WindowFieldMask. Referenced by osg::QTWindowBase::copyFromBin(). 00262 { 00263 Inherited::copyFromBin(pMem, whichField); 00264 00265 if(FieldBits::NoField != (DisplayFieldMask & whichField)) 00266 { 00267 _sfDisplay.copyFromBin(pMem); 00268 } 00269 00270 if(FieldBits::NoField != (WindowFieldMask & whichField)) 00271 { 00272 _sfWindow.copyFromBin(pMem); 00273 } 00274 00275 if(FieldBits::NoField != (ContextFieldMask & whichField)) 00276 { 00277 _sfContext.copyFromBin(pMem); 00278 } 00279 00280 00281 }
|
|
|
Reimplemented in osg::QTWindowBase. Definition at line 72 of file OSGXWindowBase.inl. References osg::AttachmentContainerPtr::dcast(), osg::XWindowBase::getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and osg::XWindowBase::shallowCopy(). 00073 { 00074 XWindowPtr fc; 00075 00076 if(getClassType().getPrototype() != OSG::NullFC) 00077 { 00078 fc = XWindowPtr::dcast( 00079 getClassType().getPrototype()-> shallowCopy()); 00080 } 00081 00082 return fc; 00083 }
|
|
|
Reimplemented in osg::QTWindowBase. Definition at line 87 of file OSGXWindowBase.inl. References osg::FieldContainer::newPtr(). 00088 { 00089 XWindowPtr returnValue; 00090 00091 newPtr(returnValue); 00092 00093 return returnValue; 00094 }
|
|
|
Implements osg::FieldContainer. Reimplemented in osg::QTWindowBase. Definition at line 139 of file OSGXWindowBase.cpp. References osg::FieldContainer::newPtr(). Referenced by osg::XWindowBase::create(). 00140 { 00141 XWindowPtr returnValue; 00142 00143 newPtr(returnValue, dynamic_cast<const XWindow *>(this)); 00144 00145 return returnValue; 00146 }
|
|
||||||||||||
|
Definition at line 284 of file OSGXWindowBase.cpp. References osg::XWindowBase::_sfContext, osg::XWindowBase::_sfDisplay, osg::XWindowBase::_sfWindow, osg::XWindowBase::ContextFieldMask, osg::XWindowBase::DisplayFieldMask, osg::WindowBase::executeSyncImpl(), osg::FieldBits::NoField, osg::SField< FieldTypeT, fieldNameSpace >::syncWith(), and osg::XWindowBase::WindowFieldMask. Referenced by osg::XWindowBase::executeSync(), and osg::QTWindowBase::executeSyncImpl(). 00286 { 00287 00288 Inherited::executeSyncImpl(pOther, whichField); 00289 00290 if(FieldBits::NoField != (DisplayFieldMask & whichField)) 00291 _sfDisplay.syncWith(pOther->_sfDisplay); 00292 00293 if(FieldBits::NoField != (WindowFieldMask & whichField)) 00294 _sfWindow.syncWith(pOther->_sfWindow); 00295 00296 if(FieldBits::NoField != (ContextFieldMask & whichField)) 00297 _sfContext.syncWith(pOther->_sfContext); 00298 00299 00300 }
|
|
||||||||||||