openscenegraph
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osgViewer::GraphicsWindowWin32 Class Reference
Inheritance diagram for osgViewer::GraphicsWindowWin32:
osgViewer::GraphicsWindow osgViewer::GraphicsHandleWin32 osg::GraphicsContext osgGA::GUIActionAdapter osg::Object osg::Referenced

Classes

struct  WindowData

Public Member Functions

 GraphicsWindowWin32 (osg::GraphicsContext::Traits *traits)
 ~GraphicsWindowWin32 ()
virtual bool isSameKindAs (const Object *object) const
virtual const char * libraryName () const
virtual const char * className () const
virtual bool valid () const
virtual bool realizeImplementation ()
virtual bool isRealizedImplementation () const
virtual void closeImplementation ()
virtual bool makeCurrentImplementation ()
virtual bool releaseContextImplementation ()
virtual void swapBuffersImplementation ()
virtual void checkEvents ()
virtual bool setWindowRectangleImplementation (int x, int y, int width, int height)
virtual bool setWindowDecorationImplementation (bool flag)
virtual void grabFocus ()
virtual void grabFocusIfPointerInWindow ()
virtual void requestWarpPointer (float x, float y)
virtual void raiseWindow ()
virtual void setWindowName (const std::string &)
virtual void useCursor (bool)
virtual void setCursor (MouseCursor cursor)
virtual void setSyncToVBlank (bool on)
virtual void setSwapGroup (bool on, GLuint group, GLuint barrier)
virtual LRESULT handleNativeWindowingEvent (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- Public Member Functions inherited from osgViewer::GraphicsWindow
 GraphicsWindow ()
void setEventQueue (osgGA::EventQueue *eventQueue)
osgGA::EventQueuegetEventQueue ()
const osgGA::EventQueuegetEventQueue () const
void setWindowRectangle (int x, int y, int width, int height)
virtual void getWindowRectangle (int &x, int &y, int &width, int &height)
void setWindowDecoration (bool flag)
virtual bool getWindowDecoration () const
virtual std::string getWindowName ()
bool getSyncToVBlank () const
void getSwapGroup (bool &on, GLuint &group, GLuint &barrier) const
virtual bool makeContextCurrentImplementation (GraphicsContext *)
virtual void bindPBufferToTextureImplementation (GLenum)
void getViews (Views &views)
virtual void requestRedraw ()
virtual void requestContinuousUpdate (bool=true)
- Public Member Functions inherited from osg::GraphicsContext
void add (Operation *operation)
void remove (Operation *operation)
void remove (const std::string &name)
void removeAllOperations ()
void runOperations ()
GraphicsOperationQueuegetOperationsQueue ()
OpenThreads::MutexgetOperationsMutex ()
osg::RefBlockgetOperationsBlock ()
OperationgetCurrentOperation ()
const TraitsgetTraits () const
void setState (State *state)
StategetState ()
const StategetState () const
void setClearColor (const Vec4 &color)
const Vec4getClearColor () const
void setClearMask (GLbitfield mask)
GLbitfield getClearMask () const
virtual void clear ()
double getTimeSinceLastClear () const
bool realize ()
void close (bool callCloseImplementation=true)
void swapBuffers ()
bool isRealized () const
bool makeCurrent ()
bool makeContextCurrent (GraphicsContext *readContext)
bool releaseContext ()
bool isCurrent () const
void bindPBufferToTexture (GLenum buffer)
void createGraphicsThread ()
void setGraphicsThread (GraphicsThread *gt)
GraphicsThreadgetGraphicsThread ()
const GraphicsThreadgetGraphicsThread () const
virtual bool makeContextCurrentImplementation (GraphicsContext *readContext)=0
void setSwapCallback (SwapCallback *rc)
SwapCallbackgetSwapCallback ()
const SwapCallbackgetSwapCallback () const
void swapBuffersCallbackOrImplemenation ()
void resized (int x, int y, int width, int height)
void setResizedCallback (ResizedCallback *rc)
ResizedCallbackgetResizedCallback ()
const ResizedCallbackgetResizedCallback () const
virtual void resizedImplementation (int x, int y, int width, int height)
CamerasgetCameras ()
const CamerasgetCameras () const
void setDefaultFboId (GLuint i)
GLuint getDefaultFboId () const
virtual bool isSameKindAs (const Object *object) const
- Public Member Functions inherited from osg::Object
 Object ()
 Object (bool threadSafeRefUnref)
 Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual void setThreadSafeRefUnref (bool threadSafe)
virtual void setName (const std::string &name)
void setName (const char *name)
const std::string & getName () const
void setDataVariance (DataVariance dv)
DataVariance getDataVariance () const
virtual void computeDataVariance ()
void setUserDataContainer (osg::UserDataContainer *udc)
osg::UserDataContainergetUserDataContainer ()
const osg::UserDataContainergetUserDataContainer () const
osg::UserDataContainergetOrCreateUserDataContainer ()
virtual void setUserData (Referenced *obj)
virtual ReferencedgetUserData ()
virtual const ReferencedgetUserData () const
template<typename T >
bool getUserValue (const std::string &name, T &value) const
template<typename T >
void setUserValue (const std::string &name, const T &value)
virtual void resizeGLObjectBuffers (unsigned int)
virtual void releaseGLObjects (osg::State *=0) const
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 Referenced (bool threadSafeRefUnref)
 Referenced (const Referenced &)
Referencedoperator= (const Referenced &)
bool getThreadSafeRefUnref () const
OpenThreads::MutexgetRefMutex () const
int ref () const
int unref () const
int unref_nodelete () const
int referenceCount () const
ObserverSetgetObserverSet () const
ObserverSetgetOrCreateObserverSet () const
void addObserver (Observer *observer) const
void removeObserver (Observer *observer) const
- Public Member Functions inherited from osgGA::GUIActionAdapter
virtual ~GUIActionAdapter ()
virtual osg::ViewasView ()
- Public Member Functions inherited from osgViewer::GraphicsHandleWin32
 GraphicsHandleWin32 ()
void setHWND (HWND hwnd)
HWND getHWND () const
void setHDC (HDC hdc)
HDC getHDC () const
void setWGLContext (HGLRC hglrc)
HGLRC getWGLContext () const

Protected Member Functions

void init ()
void registerWindow ()
void unregisterWindow ()
bool registerWindowProcedure ()
bool unregisterWindowProcedure ()
HGLRC createContextImplementation ()
bool createWindow ()
bool setWindow (HWND handle)
void destroyWindow (bool deleteNativeWindow=true)
void recreateWindow ()
bool determineWindowPositionAndStyle (unsigned int screenNum, int clientAreaX, int clientAreaY, unsigned int clientAreaWidth, unsigned int clientAreaHeight, bool decorated, int &x, int &y, unsigned int &w, unsigned int &h, unsigned int &style, unsigned int &extendedStyle)
bool setPixelFormat ()
void adaptKey (WPARAM wParam, LPARAM lParam, int &keySymbol, unsigned int &modifierMask, int &unmodifiedKeySymbol)
void transformMouseXY (float &x, float &y)
void setCursorImpl (MouseCursor cursor)
HCURSOR getOrCreateCursor (MouseCursor mouseShape)

Protected Attributes

HCURSOR _currentCursor
WNDPROC _windowProcedure
double _timeOfLastCheckEvents
int _screenOriginX
int _screenOriginY
unsigned int _screenWidth
unsigned int _screenHeight
int _windowOriginXToRealize
int _windowOriginYToRealize
unsigned int _windowWidthToRealize
unsigned int _windowHeightToRealize
bool _initialized
bool _valid
bool _realized
bool _ownsWindow
bool _closeWindow
bool _destroyWindow
bool _destroying
MouseCursor _mouseCursor
MouseCursor _appMouseCursor
 Persist which mouse cursor was used before switching to the resize cursors.
std::map< MouseCursor, HCURSOR > _mouseCursorMap
std::map< std::pair< int, int >
, bool > 
_keyMap
bool _applyWorkaroundForMultimonitorMultithreadNVidiaWin32Issues
- Protected Attributes inherited from osgViewer::GraphicsWindow
osg::ref_ptr< osgGA::EventQueue_eventQueue
- Protected Attributes inherited from osg::GraphicsContext
Cameras _cameras
ref_ptr< Traits_traits
ref_ptr< State_state
Vec4 _clearColor
GLbitfield _clearMask
OpenThreads::Thread_threadOfLastMakeCurrent
OpenThreads::Mutex _operationsMutex
osg::ref_ptr< osg::RefBlock_operationsBlock
GraphicsOperationQueue _operations
osg::ref_ptr< Operation_currentOperation
ref_ptr< GraphicsThread_graphicsThread
ref_ptr< ResizedCallback_resizedCallback
ref_ptr< SwapCallback_swapCallback
Timer_t _lastClearTick
GLuint _defaultFboId
- Protected Attributes inherited from osg::Object
std::string _name
DataVariance _dataVariance
osg::UserDataContainer_userDataContainer
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
OpenThreads::Atomic _refCount
- Protected Attributes inherited from osgViewer::GraphicsHandleWin32
HWND _hwnd
HDC _hdc
HGLRC _hglrc

Additional Inherited Members

- Public Types inherited from osgViewer::GraphicsWindow
enum  MouseCursor {
  InheritCursor, NoCursor, RightArrowCursor, LeftArrowCursor,
  InfoCursor, DestroyCursor, HelpCursor, CycleCursor,
  SprayCursor, WaitCursor, TextCursor, CrosshairCursor,
  HandCursor, UpDownCursor, LeftRightCursor, TopSideCursor,
  BottomSideCursor, LeftSideCursor, RightSideCursor, TopLeftCorner,
  TopRightCorner, BottomRightCorner, BottomLeftCorner
}
typedef std::list
< osgViewer::View * > 
Views
- Static Public Member Functions inherited from osg::GraphicsContext
static void setWindowingSystemInterface (WindowingSystemInterface *wsInterface)
static WindowingSystemInterfacegetWindowingSystemInterface ()
static GraphicsContextcreateGraphicsContext (Traits *traits)
static unsigned int createNewContextID ()
static unsigned int getMaxContextID ()
static void incrementContextIDUsageCount (unsigned int contextID)
static void decrementContextIDUsageCount (unsigned int contextID)
static GraphicsContexts getAllRegisteredGraphicsContexts ()
static GraphicsContexts getRegisteredGraphicsContexts (unsigned int contextID)
static void setCompileContext (unsigned int contextID, GraphicsContext *gc)
static GraphicsContextgetOrCreateCompileContext (unsigned int contextID)
static GraphicsContextgetCompileContext (unsigned int contextID)
- Static Protected Member Functions inherited from osg::GraphicsContext
static void registerGraphicsContext (GraphicsContext *gc)
static void unregisterGraphicsContext (GraphicsContext *gc)

Constructor & Destructor Documentation

osgViewer::GraphicsWindowWin32::GraphicsWindowWin32 ( osg::GraphicsContext::Traits traits)
osgViewer::GraphicsWindowWin32::~GraphicsWindowWin32 ( )

Member Function Documentation

void osgViewer::GraphicsWindowWin32::adaptKey ( WPARAM  wParam,
LPARAM  lParam,
int &  keySymbol,
unsigned int &  modifierMask,
int &  unmodifiedKeySymbol 
)
protected
virtual void osgViewer::GraphicsWindowWin32::checkEvents ( )
virtual

Check to see if any events have been generated.

Reimplemented from osgViewer::GraphicsWindow.

virtual const char* osgViewer::GraphicsWindowWin32::className ( ) const
inlinevirtual

return the name of the object's class type. Must be defined by derived classes.

Reimplemented from osgViewer::GraphicsWindow.

virtual void osgViewer::GraphicsWindowWin32::closeImplementation ( )
virtual

Close the graphics context.

Reimplemented from osgViewer::GraphicsWindow.

HGLRC osgViewer::GraphicsWindowWin32::createContextImplementation ( )
protected
bool osgViewer::GraphicsWindowWin32::createWindow ( )
protected
void osgViewer::GraphicsWindowWin32::destroyWindow ( bool  deleteNativeWindow = true)
protected
bool osgViewer::GraphicsWindowWin32::determineWindowPositionAndStyle ( unsigned int  screenNum,
int  clientAreaX,
int  clientAreaY,
unsigned int  clientAreaWidth,
unsigned int  clientAreaHeight,
bool  decorated,
int &  x,
int &  y,
unsigned int &  w,
unsigned int &  h,
unsigned int &  style,
unsigned int &  extendedStyle 
)
protected
HCURSOR osgViewer::GraphicsWindowWin32::getOrCreateCursor ( MouseCursor  mouseShape)
protected
virtual void osgViewer::GraphicsWindowWin32::grabFocus ( )
virtual

Get focus.

Reimplemented from osgViewer::GraphicsWindow.

virtual void osgViewer::GraphicsWindowWin32::grabFocusIfPointerInWindow ( )
virtual

Get focus on if the pointer is in this window.

Reimplemented from osgViewer::GraphicsWindow.

virtual LRESULT osgViewer::GraphicsWindowWin32::handleNativeWindowingEvent ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
virtual

Handle a native (Win32) windowing event as received from the system

void osgViewer::GraphicsWindowWin32::init ( )
protected
virtual bool osgViewer::GraphicsWindowWin32::isRealizedImplementation ( ) const
inlinevirtual

Return true if the graphics context has been realized and is ready to use.

Reimplemented from osgViewer::GraphicsWindow.

virtual bool osgViewer::GraphicsWindowWin32::isSameKindAs ( const Object object) const
inlinevirtual

Reimplemented from osgViewer::GraphicsWindow.

virtual const char* osgViewer::GraphicsWindowWin32::libraryName ( ) const
inlinevirtual

return the name of the object's library. Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.

Reimplemented from osgViewer::GraphicsWindow.

virtual bool osgViewer::GraphicsWindowWin32::makeCurrentImplementation ( )
virtual

Make this graphics context current.

Reimplemented from osgViewer::GraphicsWindow.

virtual void osgViewer::GraphicsWindowWin32::raiseWindow ( )
virtual

Raise specified window

Reimplemented from osgViewer::GraphicsWindow.

virtual bool osgViewer::GraphicsWindowWin32::realizeImplementation ( )
virtual

Realize the GraphicsContext.

Reimplemented from osgViewer::GraphicsWindow.

void osgViewer::GraphicsWindowWin32::recreateWindow ( )
protected
void osgViewer::GraphicsWindowWin32::registerWindow ( )
protected
bool osgViewer::GraphicsWindowWin32::registerWindowProcedure ( )
protected
virtual bool osgViewer::GraphicsWindowWin32::releaseContextImplementation ( )
virtual

Release the graphics context.

Reimplemented from osgViewer::GraphicsWindow.

virtual void osgViewer::GraphicsWindowWin32::requestWarpPointer ( float  x,
float  y 
)
virtual

Override from GUIActionAdapter.

Reimplemented from osgViewer::GraphicsWindow.

virtual void osgViewer::GraphicsWindowWin32::setCursor ( MouseCursor  cursor)
virtual

Set mouse cursor to a specific shape.

Reimplemented from osgViewer::GraphicsWindow.

void osgViewer::GraphicsWindowWin32::setCursorImpl ( MouseCursor  cursor)
protected
bool osgViewer::GraphicsWindowWin32::setPixelFormat ( )
protected
virtual void osgViewer::GraphicsWindowWin32::setSwapGroup ( bool  on,
GLuint  group,
GLuint  barrier 
)
virtual

Set swap group.

Reimplemented from osgViewer::GraphicsWindow.

virtual void osgViewer::GraphicsWindowWin32::setSyncToVBlank ( bool  on)
virtual

Set sync-to-vblank.

Reimplemented from osgViewer::GraphicsWindow.

bool osgViewer::GraphicsWindowWin32::setWindow ( HWND  handle)
protected
virtual bool osgViewer::GraphicsWindowWin32::setWindowDecorationImplementation ( bool  flag)
virtual

Set Window decoration.

Reimplemented from osgViewer::GraphicsWindow.

virtual void osgViewer::GraphicsWindowWin32::setWindowName ( const std::string &  )
virtual

Set the name of the window

Reimplemented from osgViewer::GraphicsWindow.

virtual bool osgViewer::GraphicsWindowWin32::setWindowRectangleImplementation ( int  x,
int  y,
int  width,
int  height 
)
virtual

Set the window's position and size.

Reimplemented from osgViewer::GraphicsWindow.

virtual void osgViewer::GraphicsWindowWin32::swapBuffersImplementation ( )
virtual

Swap the front and back buffers.

Reimplemented from osgViewer::GraphicsWindow.

void osgViewer::GraphicsWindowWin32::transformMouseXY ( float &  x,
float &  y 
)
protected
void osgViewer::GraphicsWindowWin32::unregisterWindow ( )
protected
bool osgViewer::GraphicsWindowWin32::unregisterWindowProcedure ( )
protected
virtual void osgViewer::GraphicsWindowWin32::useCursor ( bool  )
virtual

Switch on/off the cursor.

Reimplemented from osgViewer::GraphicsWindow.

virtual bool osgViewer::GraphicsWindowWin32::valid ( ) const
inlinevirtual

Return whether a valid and usable GraphicsContext has been created.

Reimplemented from osgViewer::GraphicsWindow.

Member Data Documentation

bool osgViewer::GraphicsWindowWin32::_applyWorkaroundForMultimonitorMultithreadNVidiaWin32Issues
protected
MouseCursor osgViewer::GraphicsWindowWin32::_appMouseCursor
protected

Persist which mouse cursor was used before switching to the resize cursors.

bool osgViewer::GraphicsWindowWin32::_closeWindow
protected
HCURSOR osgViewer::GraphicsWindowWin32::_currentCursor
protected
bool osgViewer::GraphicsWindowWin32::_destroying
protected
bool osgViewer::GraphicsWindowWin32::_destroyWindow
protected
bool osgViewer::GraphicsWindowWin32::_initialized
protected
std::map<std::pair<int, int>, bool> osgViewer::GraphicsWindowWin32::_keyMap
protected
MouseCursor osgViewer::GraphicsWindowWin32::_mouseCursor
protected
std::map<MouseCursor,HCURSOR> osgViewer::GraphicsWindowWin32::_mouseCursorMap
protected
bool osgViewer::GraphicsWindowWin32::_ownsWindow
protected
bool osgViewer::GraphicsWindowWin32::_realized
protected
unsigned int osgViewer::GraphicsWindowWin32::_screenHeight
protected
int osgViewer::GraphicsWindowWin32::_screenOriginX
protected
int osgViewer::GraphicsWindowWin32::_screenOriginY
protected
unsigned int osgViewer::GraphicsWindowWin32::_screenWidth
protected
double osgViewer::GraphicsWindowWin32::_timeOfLastCheckEvents
protected
bool osgViewer::GraphicsWindowWin32::_valid
protected
unsigned int osgViewer::GraphicsWindowWin32::_windowHeightToRealize
protected
int osgViewer::GraphicsWindowWin32::_windowOriginXToRealize
protected
int osgViewer::GraphicsWindowWin32::_windowOriginYToRealize
protected
WNDPROC osgViewer::GraphicsWindowWin32::_windowProcedure
protected
unsigned int osgViewer::GraphicsWindowWin32::_windowWidthToRealize
protected

The documentation for this class was generated from the following file: