Added WindowData structures to GraphicsWindowX11,Win32 and Carbon to help support
GraphicsWindow inheriting their window handles from an external toolkit
This commit is contained in:
@@ -32,13 +32,14 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow
|
||||
public:
|
||||
|
||||
GraphicsWindowCarbon(osg::GraphicsContext::Traits* traits):
|
||||
_ownWindow(true),
|
||||
_valid(false),
|
||||
_initialized(false),
|
||||
_realized(false)
|
||||
{
|
||||
_traits = traits;
|
||||
|
||||
init();
|
||||
init(traits ? dynamic_cast<WindowData*>(traits->inheritedWindowData.get()) : 0);
|
||||
|
||||
if (valid())
|
||||
{
|
||||
@@ -98,9 +99,18 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow
|
||||
bool handleMouseEvent(EventRef theEvent);
|
||||
bool handleKeyboardEvent(EventRef theEvent);
|
||||
|
||||
/** WindowData is used to pass in the X11 window handle attached the GraphicsContext::Traits structure. */
|
||||
struct WindowData : public osg::Referenced
|
||||
{
|
||||
WindowData(Window window):
|
||||
_window(window) {}
|
||||
|
||||
Window _window;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
void init();
|
||||
void init(WindowData* inheritedWindowData=0);
|
||||
|
||||
void transformMouseXY(float& x, float& y);
|
||||
|
||||
@@ -111,6 +121,7 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow
|
||||
bool _realized;
|
||||
bool _useWindowDecoration;
|
||||
|
||||
bool _ownsWindow;
|
||||
WindowRef _window;
|
||||
AGLContext _context;
|
||||
AGLPixelFormat _pixelFormat;
|
||||
|
||||
Reference in New Issue
Block a user