44 #include <QtCore/QVector> 47 #include <X11/extensions/Xrender.h> 78 spec[i++] = GLX_LEVEL;
102 spec[i++] = GLX_BUFFER_SIZE; spec[i++] = 8;
105 spec[i++] = GLX_DOUBLEBUFFER; spec[i++] = format.
doubleBuffer() ? True : False;
106 spec[i++] = GLX_STEREO; spec[i++] = format.
stereo() ? True : False;
108 if (format.
depth()) {
129 GLXFBConfig chosenConfig = 0;
131 while (!chosenConfig && reduced) {
134 GLXFBConfig *configs;
138 for (
int i = 0; i < confcount; i++) {
139 chosenConfig = configs[i];
141 if (reducedFormat.
alpha()) {
145 XVisualInfo *visual = glXGetVisualFromFBConfig(display, chosenConfig);
146 #if !defined(QT_NO_XRENDER) 147 XRenderPictFormat *pictFormat = XRenderFindVisualFormat(display, visual->visual);
148 if (pictFormat->direct.alphaMask > 0)
151 if (visual->depth == 32)
166 qWarning(
"Warning: no suitable glx confiuration found");
174 XVisualInfo *visualInfo = glXGetVisualFromFBConfig(display,config);
187 int sampleBuffers = 0;
197 XVisualInfo *vi = glXGetVisualFromFBConfig(display,config);
198 glXGetConfig(display,vi,GLX_RGBA,&rgba);
241 }
else if (retFormat.
stereo()) {
243 }
else if (retFormat.
accum()) {
245 }
else if (retFormat.
stencil()) {
247 }
else if (retFormat.
alpha()) {
249 }
else if (retFormat.
depth()) {
QVector< int > qglx_buildSpec(const QPlatformWindowFormat &format, int drawableBit)
QPlatformWindowFormat qglx_platformWindowFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext ctx)
#define glXGetFBConfigAttrib
#define glXChooseFBConfig
#define GLX_SAMPLE_BUFFERS_ARB
#define GLX_DRAWABLE_TYPE
Q_GUI_EXPORT EGLDisplay display()
QPlatformWindowFormat qglx_reducePlatformWindowFormat(const QPlatformWindowFormat &format, bool *reduced)
Q_CORE_EXPORT void qWarning(const char *,...)
GLXFBConfig qglx_findConfig(Display *display, int screen, const QPlatformWindowFormat &format, int drawableBit)
XVisualInfo * qglx_findVisualInfo(Display *display, int screen, const QPlatformWindowFormat &format)
const T * constData() const
Returns a const pointer to the data stored in the vector.