From 176f30b13739b352cbe453cba7796d9a9c808bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 21 Jun 2011 13:39:26 +0200 Subject: OpenGL API refactor. Rename QGuiGLFormat to QSurfaceFormat, and make QWindow sub-class of QSurface and QPlatformWindow sub-class of QPlatformSurface, instead of having QPlatformGLSurface accessor in QWindow. --- .../glxconvenience/qglxconvenience.cpp | 20 ++++++++++---------- .../glxconvenience/qglxconvenience_p.h | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/platformsupport/glxconvenience') diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp index fc506df3bd..ce0c49d93f 100644 --- a/src/platformsupport/glxconvenience/qglxconvenience.cpp +++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp @@ -70,7 +70,7 @@ enum { #undef FontChange #endif -QVector qglx_buildSpec(const QGuiGLFormat &format, int drawableBit) +QVector qglx_buildSpec(const QSurfaceFormat &format, int drawableBit) { QVector spec(48); int i = 0; @@ -88,7 +88,7 @@ QVector qglx_buildSpec(const QGuiGLFormat &format, int drawableBit) spec[i++] = GLX_ALPHA_SIZE; spec[i++] = format.alphaBufferSize(); } - spec[i++] = GLX_DOUBLEBUFFER; spec[i++] = format.swapBehavior() != QGuiGLFormat::SingleBuffer ? True : False; + spec[i++] = GLX_DOUBLEBUFFER; spec[i++] = format.swapBehavior() != QSurfaceFormat::SingleBuffer ? True : False; spec[i++] = GLX_STEREO; spec[i++] = format.stereo() ? True : False; @@ -111,11 +111,11 @@ QVector qglx_buildSpec(const QGuiGLFormat &format, int drawableBit) return spec; } -GLXFBConfig qglx_findConfig(Display *display, int screen , const QGuiGLFormat &format, int drawableBit) +GLXFBConfig qglx_findConfig(Display *display, int screen , const QSurfaceFormat &format, int drawableBit) { bool reduced = true; GLXFBConfig chosenConfig = 0; - QGuiGLFormat reducedFormat = format; + QSurfaceFormat reducedFormat = format; while (!chosenConfig && reduced) { QVector spec = qglx_buildSpec(reducedFormat, drawableBit); int confcount = 0; @@ -147,7 +147,7 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , const QGuiGLFormat &f XFree(configs); } - reducedFormat = qglx_reduceGuiGLFormat(reducedFormat,&reduced); + reducedFormat = qglx_reduceSurfaceFormat(reducedFormat,&reduced); } if (!chosenConfig) @@ -156,16 +156,16 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , const QGuiGLFormat &f return chosenConfig; } -XVisualInfo *qglx_findVisualInfo(Display *display, int screen, const QGuiGLFormat &format) +XVisualInfo *qglx_findVisualInfo(Display *display, int screen, const QSurfaceFormat &format) { GLXFBConfig config = qglx_findConfig(display,screen,format); XVisualInfo *visualInfo = glXGetVisualFromFBConfig(display,config); return visualInfo; } -QGuiGLFormat qglx_guiGLFormatFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext) +QSurfaceFormat qglx_surfaceFormatFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext) { - QGuiGLFormat format; + QSurfaceFormat format; int redSize = 0; int greenSize = 0; int blueSize = 0; @@ -203,9 +203,9 @@ QGuiGLFormat qglx_guiGLFormatFromGLXFBConfig(Display *display, GLXFBConfig confi return format; } -QGuiGLFormat qglx_reduceGuiGLFormat(const QGuiGLFormat &format, bool *reduced) +QSurfaceFormat qglx_reduceSurfaceFormat(const QSurfaceFormat &format, bool *reduced) { - QGuiGLFormat retFormat = format; + QSurfaceFormat retFormat = format; *reduced = true; if (retFormat.samples() > 1) { diff --git a/src/platformsupport/glxconvenience/qglxconvenience_p.h b/src/platformsupport/glxconvenience/qglxconvenience_p.h index 1a0510067b..4892b07729 100644 --- a/src/platformsupport/glxconvenience/qglxconvenience_p.h +++ b/src/platformsupport/glxconvenience/qglxconvenience_p.h @@ -42,16 +42,16 @@ #ifndef QGLXCONVENIENCE_H #define QGLXCONVENIENCE_H -#include +#include #include #include #include -XVisualInfo *qglx_findVisualInfo(Display *display, int screen, const QGuiGLFormat &format); -GLXFBConfig qglx_findConfig(Display *display, int screen, const QGuiGLFormat &format, int drawableBit = GLX_WINDOW_BIT); -QGuiGLFormat qglx_guiGLFormatFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext context); -QVector qglx_buildSpec(const QGuiGLFormat &format, int drawableBit = GLX_WINDOW_BIT); -QGuiGLFormat qglx_reduceGuiGLFormat(const QGuiGLFormat &format, bool *reduced); +XVisualInfo *qglx_findVisualInfo(Display *display, int screen, const QSurfaceFormat &format); +GLXFBConfig qglx_findConfig(Display *display, int screen, const QSurfaceFormat &format, int drawableBit = GLX_WINDOW_BIT); +QSurfaceFormat qglx_surfaceFormatFromGLXFBConfig(Display *display, GLXFBConfig config, GLXContext context); +QVector qglx_buildSpec(const QSurfaceFormat &format, int drawableBit = GLX_WINDOW_BIT); +QSurfaceFormat qglx_reduceSurfaceFormat(const QSurfaceFormat &format, bool *reduced); #endif // QGLXCONVENIENCE_H -- cgit v1.2.3