14#ifndef OSGVIEWER_GRAPHICWINDOW
15#define OSGVIEWER_GRAPHICWINDOW 1
49 virtual const char*
libraryName()
const {
return "osgViewer"; }
50 virtual const char*
className()
const {
return "GraphicsWindow"; }
79 _traits->windowDecoration = flag;
144 osg::notify(
osg::NOTICE) <<
"GraphicsWindow::setSyncToVBlank(" << on <<
") not implemented." << std::endl;
152 osg::notify(
osg::NOTICE) <<
"GraphicsWindow::setSwapGroup(" << on <<
" " << group <<
" " << barrier <<
") not implemented." << std::endl;
195 typedef std::list<osgViewer::View*>
Views;
231 _traits =
new GraphicsContext::Traits;
242 virtual const char*
className()
const {
return "GraphicsWindowEmbedded"; }
264 virtual bool valid()
const {
return true; }
282#define USE_GRAPICSWINDOW_IMPLEMENTATION(ext) \
283 extern "C" void graphicswindow_##ext(void); \
284 static osgViewer::GraphicsWindowFunctionProxy graphicswindowproxy_##ext(graphicswindow_##ext);
287 #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32)
288#elif defined(__APPLE__)
289 #if defined(OSG_WINDOWING_SYSTEM_CARBON)
290 #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon)
292 #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Cocoa)
295 #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11)
void(* CGraphicsWindowFunction)(void)
Definition GraphicsWindow:28
@ NOTICE
Definition Notify:34
std::ostream & notify(void)
Definition Notify:80
The osgViewer library provides high level viewer functionality designed to make it easier to write a ...
Base class for providing Windowing API agnostic access to creating and managing graphics context.
Definition GraphicsContext:30
void resized(int x, int y, int width, int height)
resized method should be called when the underlying window has been resized and the GraphicsWindow an...
Definition GraphicsContext:476
ref_ptr< Traits > _traits
Definition GraphicsContext:544
static unsigned int createNewContextID()
Create a contextID for a new graphics context, this contextID is used to set up the osg::State associ...
static void incrementContextIDUsageCount(unsigned int contextID)
Increment the usage count associate with a contextID.
void setState(State *state)
Set the State object which tracks the current OpenGL state for this graphics context.
Definition GraphicsContext:331
State * getState()
Get the State object which tracks the current OpenGL state for this graphics context.
Definition GraphicsContext:334
GraphicsContext Traits object provides the specification of what type of graphics context is required...
Definition GraphicsContext:70
Object()
Construct an object.
Definition Object:69
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
void setContextID(unsigned int contextID)
Set the current OpenGL context uniqueID.
Definition State:111
void setGraphicsContext(GraphicsContext *context)
Set the graphics context associated with that owns this State object.
Definition State:87
EventQueue implementation for collecting and adapting windowing events.
Definition EventQueue:31
Definition GUIActionAdapter:62
virtual void grabFocus()
Get focus.
Definition GraphicsWindow:91
virtual bool isRealizedImplementation() const
Return true if the graphics context has been realized, and is ready to use, implementation.
Definition GraphicsWindow:168
virtual void setWindowName(const std::string &)
Set the name of the window.
Definition GraphicsWindow:127
virtual void setSyncToVBlank(bool on)
Create a new mouse cursor from the usual bitmap data.
Definition GraphicsWindow:142
void setWindowDecoration(bool flag)
Set Window decoration.
Definition GraphicsWindow:75
virtual bool makeContextCurrentImplementation(GraphicsContext *)
Make this graphics context current with specified read context implementation.
Definition GraphicsWindow:180
virtual void requestWarpPointer(float, float)
requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer to a specified x,...
Definition GraphicsWindow:207
osg::ref_ptr< osgGA::EventQueue > _eventQueue
Definition GraphicsWindow:212
virtual bool setWindowDecorationImplementation(bool)
implementation of setWindowDecoration, should be implemented by derived classes
Definition GraphicsWindow:84
void setWindowRectangle(int x, int y, int width, int height)
Set the window's position and size.
Definition GraphicsWindow:60
std::list< osgViewer::View * > Views
Definition GraphicsWindow:195
virtual bool makeCurrentImplementation()
Make this graphics context current implementation.
Definition GraphicsWindow:176
virtual bool getWindowDecoration() const
Set Window decoration.
Definition GraphicsWindow:88
void setEventQueue(osgGA::EventQueue *eventQueue)
Definition GraphicsWindow:52
GraphicsWindow()
Definition GraphicsWindow:46
virtual void requestContinuousUpdate(bool=true)
requestContinuousUpdate(bool) is for en/disabling a throw or idle callback to be requested by a GUIEv...
Definition GraphicsWindow:204
const osgGA::EventQueue * getEventQueue() const
Definition GraphicsWindow:54
virtual void closeImplementation()
Close the graphics context implementation.
Definition GraphicsWindow:172
virtual std::string getWindowName()
Return the name of the window.
Definition GraphicsWindow:130
void getViews(Views &views)
Returns the list of views (osgViewer::View) attached to this GraphicsWindow.
MouseCursor
Mouse cursor types, the same ones already present with ancient glut ...
Definition GraphicsWindow:100
@ LeftArrowCursor
Definition GraphicsWindow:104
@ BottomSideCursor
Definition GraphicsWindow:117
@ TopSideCursor
Definition GraphicsWindow:116
@ SprayCursor
Definition GraphicsWindow:109
@ InheritCursor
Definition GraphicsWindow:101
@ LeftSideCursor
Definition GraphicsWindow:118
@ LeftRightCursor
Definition GraphicsWindow:115
@ BottomLeftCorner
Definition GraphicsWindow:123
@ BottomRightCorner
Definition GraphicsWindow:122
@ TopRightCorner
Definition GraphicsWindow:121
@ CycleCursor
Definition GraphicsWindow:108
@ CrosshairCursor
Definition GraphicsWindow:112
@ HelpCursor
Definition GraphicsWindow:107
@ DestroyCursor
Definition GraphicsWindow:106
@ WaitCursor
Definition GraphicsWindow:110
@ TextCursor
Definition GraphicsWindow:111
@ HandCursor
Definition GraphicsWindow:113
@ RightArrowCursor
Definition GraphicsWindow:103
@ TopLeftCorner
Definition GraphicsWindow:120
@ RightSideCursor
Definition GraphicsWindow:119
@ UpDownCursor
Definition GraphicsWindow:114
@ InfoCursor
Definition GraphicsWindow:105
@ NoCursor
Definition GraphicsWindow:102
virtual const char * libraryName() const
return the name of the object's library.
Definition GraphicsWindow:49
virtual void raiseWindow()
Raise the window to the top.
Definition GraphicsWindow:97
virtual bool valid() const
Return whether a valid and usable GraphicsContext has been created.
Definition GraphicsWindow:160
virtual bool setWindowRectangleImplementation(int, int, int, int)
implementation of setWindowRectangle, should be implemented by derived classes
Definition GraphicsWindow:69
virtual void useCursor(bool cursorOn)
Switch on/off the cursor.
Definition GraphicsWindow:133
virtual void grabFocusIfPointerInWindow()
Get focus on if the pointer is in this window.
Definition GraphicsWindow:94
virtual void requestRedraw()
requestRedraw() requests a single redraw.
bool getSyncToVBlank() const
Definition GraphicsWindow:147
virtual bool isSameKindAs(const Object *object) const
Definition GraphicsWindow:48
virtual void swapBuffersImplementation()
Swap the front and back buffers implementation.
Definition GraphicsWindow:191
virtual bool realizeImplementation()
Realize the GraphicsContext implementation, Pure virtual - must be implemented by concrete implementa...
Definition GraphicsWindow:164
void getSwapGroup(bool &on, GLuint &group, GLuint &barrier) const
Definition GraphicsWindow:155
virtual bool releaseContextImplementation()
Release the graphics context.
Definition GraphicsWindow:183
osgGA::EventQueue * getEventQueue()
Definition GraphicsWindow:53
virtual void bindPBufferToTextureImplementation(GLenum)
Pure virtual, Bind the graphics context to associated texture implementation.
Definition GraphicsWindow:187
virtual void getWindowRectangle(int &x, int &y, int &width, int &height)
Get the window's position and size.
Definition GraphicsWindow:72
virtual bool checkEvents()
Check events, return true if events have been received.
Definition GraphicsWindow:57
virtual void setCursor(MouseCursor)
Set mouse cursor to a specific shape.
Definition GraphicsWindow:136
virtual void setSwapGroup(bool on, GLuint group, GLuint barrier)
Set swap group.
Definition GraphicsWindow:150
virtual const char * className() const
return the name of the object's class type.
Definition GraphicsWindow:50
GraphicsWindowEmbedded(int x, int y, int width, int height)
Definition GraphicsWindow:229
virtual void closeImplementation()
Close the graphics context implementation.
Definition GraphicsWindow:267
virtual bool valid() const
Return whether a valid and usable GraphicsContext has been created.
Definition GraphicsWindow:264
virtual bool releaseContextImplementation()
Release the graphics context.
Definition GraphicsWindow:269
virtual void grabFocus()
Get focus.
Definition GraphicsWindow:271
virtual void swapBuffersImplementation()
Swap the front and back buffers implementation.
Definition GraphicsWindow:270
virtual bool isSameKindAs(const Object *object) const
Definition GraphicsWindow:240
virtual const char * className() const
return the name of the object's class type.
Definition GraphicsWindow:242
virtual bool isRealizedImplementation() const
Return true if the graphics context has been realized, and is ready to use, implementation.
Definition GraphicsWindow:266
GraphicsWindowEmbedded(osg::GraphicsContext::Traits *traits=0)
Definition GraphicsWindow:221
virtual const char * libraryName() const
return the name of the object's library.
Definition GraphicsWindow:241
void init()
Definition GraphicsWindow:244
virtual bool realizeImplementation()
Realize the GraphicsContext implementation, Pure virtual - must be implemented by concrete implementa...
Definition GraphicsWindow:265
virtual void raiseWindow()
Raise the window to the top.
Definition GraphicsWindow:273
virtual bool makeCurrentImplementation()
Make this graphics context current implementation.
Definition GraphicsWindow:268
virtual void grabFocusIfPointerInWindow()
Get focus on if the pointer is in this window.
Definition GraphicsWindow:272
GraphicsWindowFunctionProxy(CGraphicsWindowFunction function)
Definition GraphicsWindow:279
View holds a single view on a scene, this view may be composed of one or more slave cameras.
Definition View:76
#define OSGVIEWER_EXPORT
Definition Export:40