30 #ifndef __X11EGLSupport_H__
31 #define __X11EGLSupport_H__
34 #include "OgreEGLSupport.h"
36 #if (OGRE_PLATFORM == OGRE_PLATFORM_LINUX)
41 #include <X11/Xutil.h>
44 #include <X11/keysym.h>
46 #define StructureNotifyMask 0
47 #define VisibilityChangeMask 0
48 #define FocusChangeMask 0
50 #define CWBorderPixel 0
55 #define CWBackingStore 0
56 #define CWOverrideRedirect 0
62 #define ClientMessage 0
63 #define SubstructureRedirectMask 0
64 #define SubstructureNotifyMask 0
66 #define VisualIDMask 0
75 class NotPointerAtom{};
76 typedef NotPointerAtom * Atom;
80 class XRRScreenConfiguration{};
83 #define Window NativeWindowType
85 struct XVisualInfo{
int visualid, visual, depth;};
86 struct XRRScreenSize{
int width, height;};
87 struct XWMHints{
int initial_state, input, flags;};
88 struct XSizeHints{
int flags;};
89 struct XWindowAttributes{NativeWindowType root;
int x, y, width, height;};
90 struct XSetWindowAttributes{
int background_pixel, border_pixel, colormap, event_mask, backing_store, save_under, override_redirect;};
91 struct XTextProperty{
int * value;};
92 struct StrangeData{StrangeData(){}StrangeData(Atom atom){}StrangeData(
int num){}};
93 struct XClientMessageEventData{StrangeData l[3];};
94 struct XClientMessageEvent{
int type, serial, send_event, format; XClientMessageEventData data ; NativeWindowType window; Atom message_type;};
98 void XStringListToTextProperty(
char ** prop,
int num, XTextProperty * textProp);
99 Window DefaultRootWindow(Display* nativeDisplayType);
100 bool XQueryExtension(Display* nativeDisplayType,
char * name,
int * dummy0,
int * dummy2,
int * dummy3);
101 XRRScreenConfiguration * XRRGetScreenInfo(Display* nativeDisplayType, Window window );
102 int XRRConfigCurrentConfiguration(XRRScreenConfiguration * config, Rotation * rotation);
103 XRRScreenSize * XRRConfigSizes(XRRScreenConfiguration * config,
int * nSizes);
104 int XRRConfigCurrentRate(XRRScreenConfiguration * config);
105 short * XRRConfigRates(XRRScreenConfiguration * config,
int sizeID,
int * nRates);
106 void XRRFreeScreenConfigInfo(XRRScreenConfiguration * config);
107 int DefaultScreen(NativeDisplayType nativeDisplayType);
108 int DisplayWidth(Display* nativeDisplayType,
int screen);
109 int DisplayHeight(Display* nativeDisplayType,
int screen);
110 Display* XOpenDisplay(
int num);
111 void XCloseDisplay(Display* nativeDisplayType);
112 Atom XInternAtom(Display* nativeDisplayType,
char * name, X11Bool isTrue);;
114 const char * XDisplayName(
char * name);
115 Visual * DefaultVisual(Display* nativeDisplayType,
int screen);
116 int XVisualIDFromVisual(Visual *v);
117 void XRRSetScreenConfigAndRate(Display* nativeDisplayType, XRRScreenConfiguration * config, Window window,
int size, Rotation rotation,
int mode,
int currentTime );
118 XVisualInfo * XGetVisualInfo(Display* nativeDisplayType,
int mask, XVisualInfo * info,
int * n);
119 typedef int (*XErrorHandler)(Display *, XErrorEvent*);
120 XErrorHandler XSetErrorHandler(XErrorHandler xErrorHandler);
121 void XDestroyWindow(Display* nativeDisplayType, Window nativeWindowType);
122 bool XGetWindowAttributes(Display* nativeDisplayType, Window nativeWindowType, XWindowAttributes * xWindowAttributes);
123 int XCreateColormap(Display* nativeDisplayType, Window nativeWindowType,
int visual,
int allocNone);
124 Window XCreateWindow(Display* nativeDisplayType, Window nativeWindowType,
int left,
int top,
int width,
int height,
int dummy1,
int depth,
int inputOutput,
int visual,
int mask, XSetWindowAttributes * xSetWindowAttributes);
125 void XFree(
void *data);
126 XWMHints * XAllocWMHints();
127 XSizeHints * XAllocSizeHints();
128 void XSetWMProperties(Display* nativeDisplayType, Window nativeWindowType,XTextProperty * titleprop,
char * dummy1,
char * dummy2,
int num, XSizeHints *sizeHints, XWMHints *wmHints,
char * dummy3);
129 void XSetWMProtocols(Display* nativeDisplayType, Window nativeWindowType, Atom * atom,
int num);
130 void XMapWindow(Display* nativeDisplayType, Window nativeWindowType);
131 void XFlush(Display* nativeDisplayType);
132 void XMoveWindow(Display* nativeDisplayType, Window nativeWindowType,
int left,
int top);
133 void XResizeWindow(Display* nativeDisplayType, Window nativeWindowType,
int left,
int top);
134 void XQueryTree(Display* nativeDisplayType, Window nativeWindowType, Window * root, Window *parent, Window **children,
unsigned int * nChildren);
135 void XSendEvent(Display* nativeDisplayType, Window nativeWindowType,
int dummy1,
int mask, XEvent* xevent);
150 virtual ~X11EGLSupport();
155 virtual void switchMode(
uint& width,
uint& height,
short& frequency);
156 String getDisplayName(
void);
158 NativeDisplayType getNativeDisplay(
void);
159 XVisualInfo *getVisualFromFBConfig(::EGLConfig glConfig);
160 Atom mAtomDeleteWindow;
161 Atom mAtomFullScreen;
166 EGLDisplay getGLDisplay();
169 RenderWindow* newWindow(
const String& name,
170 unsigned int width,
unsigned int height,
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)