19 #ifndef OSGVIEWER_GRAPHICSWINDOWX11
20 #define OSGVIEWER_GRAPHICSWINDOWX11 1
22 #include <osgViewer/GraphicsWindow>
23 #include <osgViewer/api/X11/GraphicsHandleX11>
47 _timeOfLastCheckEvents(-1.0),
53 memset(_keyMap, 0, 32);
60 getState()->setGraphicsContext(
this);
62 if (_traits.valid() && _traits->sharedContext.valid())
64 getState()->setContextID( _traits->sharedContext->getState()->getContextID() );
65 incrementContextIDUsageCount( getState()->getContextID() );
76 virtual const char*
libraryName()
const {
return "osgViewer"; }
77 virtual const char*
className()
const {
return "GraphicsWindowX11"; }
79 virtual bool valid()
const {
return _valid; }
82 virtual bool realizeImplementation();
88 virtual void closeImplementation();
91 virtual bool makeCurrentImplementation();
94 virtual bool releaseContextImplementation();
97 virtual void swapBuffersImplementation();
100 virtual bool checkEvents();
103 virtual bool setWindowDecorationImplementation(
bool flag);
106 virtual void grabFocus();
109 virtual void grabFocusIfPointerInWindow();
112 virtual void raiseWindow();
115 virtual void requestWarpPointer(
float x,
float y);
118 virtual bool setWindowRectangleImplementation(
int x,
int y,
int width,
int height);
121 virtual void setWindowName(
const std::string& name);
124 virtual void setCursor(MouseCursor cursor);
140 Display* getDisplayToUse()
const ;
152 Cursor getOrCreateCursor(MouseCursor mouseShape);
154 bool createVisualInfo();
158 bool setWindow(Window window);
162 bool checkAndSendEventFullScreenIfNeeded(Display* display,
int x,
int y,
int width,
int height,
bool windowDecoration);
165 void transformMouseXY(
float& x,
float& y);
166 void adaptKey(XKeyEvent& keyevent,
int& keySymbol,
int& unmodifiedKeySymbol);
167 void forceKey(
int key,
double time,
bool state);
168 void rescanModifierMapping();
169 void getModifierMap(
char* keymap)
const;
170 int getModifierMask()
const;
172 void flushKeyEvents();
181 EGLDisplay _eglDisplay;
182 EGLSurface _eglSurface;
GraphicsWindowX11(osg::GraphicsContext::Traits *traits)
virtual const char * className() const
Display * getEventDisplay() const
virtual bool isRealizedImplementation() const
virtual bool isSameKindAs(const Object *object) const
std::map< MouseCursor, Cursor > _mouseCursorMap
WindowData(Window window)
GLint GLenum GLsizei width
static unsigned int createNewContextID()
GLint GLenum GLsizei GLsizei height
virtual bool valid() const
Cursor getCurrentCursor()
virtual const char * libraryName() const
double _timeOfLastCheckEvents
XVisualInfo * _visualInfo