30 #ifndef __X11EGLSupport_H__
31 #define __X11EGLSupport_H__
34 #include "OgreEGLSupport.h"
36 #if (OGRE_PLATFORM == OGRE_PLATFORM_LINUX)
37 #include <X11/Xutil.h>
38 #include <X11/extensions/Xrandr.h>
39 #include <X11/Xutil.h>
42 #include <X11/keysym.h>
43 #include <X11/extensions/Xrandr.h>
45 #define StructureNotifyMask 0
46 #define VisibilityChangeMask 0
47 #define FocusChangeMask 0
49 #define CWBorderPixel 0
54 #define CWBackingStore 0
55 #define CWOverrideRedirect 0
61 #define ClientMessage 0
62 #define SubstructureRedirectMask 0
63 #define SubstructureNotifyMask 0
65 #define VisualIDMask 0
74 class NotPointerAtom{};
75 typedef NotPointerAtom * Atom;
79 class XRRScreenConfiguration{};
82 #define Window NativeWindowType
84 struct XVisualInfo{
int visualid, visual, depth;};
85 struct XRRScreenSize{
int width, height;};
86 struct XWMHints{
int initial_state, input, flags;};
87 struct XSizeHints{
int flags;};
88 struct XWindowAttributes{NativeWindowType root;
int x, y, width, height;};
89 struct XSetWindowAttributes{
int background_pixel, border_pixel, colormap, event_mask, backing_store, save_under, override_redirect;};
90 struct XTextProperty{
int * value;};
91 struct StrangeData{StrangeData(){}StrangeData(Atom atom){}StrangeData(
int num){}};
92 struct XClientMessageEventData{StrangeData l[3];};
93 struct XClientMessageEvent{
int type, serial, send_event, format; XClientMessageEventData data ; NativeWindowType window; Atom message_type;};
97 void XStringListToTextProperty(
char ** prop,
int num, XTextProperty * textProp);
98 Window DefaultRootWindow(Display* nativeDisplayType);
99 bool XQueryExtension(Display* nativeDisplayType,
char * name,
int * dummy0,
int * dummy2,
int * dummy3);
100 XRRScreenConfiguration * XRRGetScreenInfo(Display* nativeDisplayType, Window window );
101 int XRRConfigCurrentConfiguration(XRRScreenConfiguration * config, Rotation * rotation);
102 XRRScreenSize * XRRConfigSizes(XRRScreenConfiguration * config,
int * nSizes);
103 int XRRConfigCurrentRate(XRRScreenConfiguration * config);
104 short * XRRConfigRates(XRRScreenConfiguration * config,
int sizeID,
int * nRates);
105 void XRRFreeScreenConfigInfo(XRRScreenConfiguration * config);
106 int DefaultScreen(NativeDisplayType nativeDisplayType);
107 int DisplayWidth(Display* nativeDisplayType,
int screen);
108 int DisplayHeight(Display* nativeDisplayType,
int screen);
109 Display* XOpenDisplay(
int num);
110 void XCloseDisplay(Display* nativeDisplayType);
111 Atom XInternAtom(Display* nativeDisplayType,
char * name, X11Bool isTrue);;
113 const char * XDisplayName(
char * name);
114 Visual * DefaultVisual(Display* nativeDisplayType,
int screen);
115 int XVisualIDFromVisual(Visual *v);
116 void XRRSetScreenConfigAndRate(Display* nativeDisplayType, XRRScreenConfiguration * config, Window window,
int size, Rotation rotation,
int mode,
int currentTime );
117 XVisualInfo * XGetVisualInfo(Display* nativeDisplayType,
int mask, XVisualInfo * info,
int * n);
118 typedef int (*XErrorHandler)(Display *, XErrorEvent*);
119 XErrorHandler XSetErrorHandler(XErrorHandler xErrorHandler);
120 void XDestroyWindow(Display* nativeDisplayType, Window nativeWindowType);
121 bool XGetWindowAttributes(Display* nativeDisplayType, Window nativeWindowType, XWindowAttributes * xWindowAttributes);
122 int XCreateColormap(Display* nativeDisplayType, Window nativeWindowType,
int visual,
int allocNone);
123 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);
124 void XFree(
void *data);
125 XWMHints * XAllocWMHints();
126 XSizeHints * XAllocSizeHints();
127 void XSetWMProperties(Display* nativeDisplayType, Window nativeWindowType,XTextProperty * titleprop,
char * dummy1,
char * dummy2,
int num, XSizeHints *sizeHints, XWMHints *wmHints,
char * dummy3);
128 void XSetWMProtocols(Display* nativeDisplayType, Window nativeWindowType, Atom * atom,
int num);
129 void XMapWindow(Display* nativeDisplayType, Window nativeWindowType);
130 void XFlush(Display* nativeDisplayType);
131 void XMoveWindow(Display* nativeDisplayType, Window nativeWindowType,
int left,
int top);
132 void XResizeWindow(Display* nativeDisplayType, Window nativeWindowType,
int left,
int top);
133 void XQueryTree(Display* nativeDisplayType, Window nativeWindowType, Window * root, Window *parent, Window **children,
unsigned int * nChildren);
134 void XSendEvent(Display* nativeDisplayType, Window nativeWindowType,
int dummy1,
int mask, XEvent* xevent);
152 size_t width,
size_t height);
154 virtual void switchMode(
uint& width,
uint& height,
short& frequency);
155 String getDisplayName(
void);
157 NativeDisplayType getNativeDisplay(
void);
158 XVisualInfo *getVisualFromFBConfig(::EGLConfig glConfig);
165 EGLDisplay getGLDisplay();
169 unsigned int width,
unsigned int height,
Manages the target rendering window.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
PixelComponentType
Pixel component format.