Qt 4.8
qgl_qpa.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtOpenGL module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include <QApplication>
43 #include <QtGui/private/qapplication_p.h>
44 #include <QPixmap>
45 #include <QDebug>
46 
47 #include <QtGui/private/qapplication_p.h>
48 #include <QtGui/QPlatformWindow>
49 
50 #include "qgl.h"
51 #include "qgl_p.h"
52 
54 
63 QGLFormat QGLFormat::fromPlatformWindowFormat(const QPlatformWindowFormat &format)
64 {
65  QGLFormat retFormat;
66  retFormat.setAccum(format.accum());
67  if (format.accumBufferSize() >= 0)
68  retFormat.setAccumBufferSize(format.accumBufferSize());
69  retFormat.setAlpha(format.alpha());
70  if (format.alphaBufferSize() >= 0)
71  retFormat.setAlphaBufferSize(format.alphaBufferSize());
72  if (format.blueBufferSize() >= 0)
73  retFormat.setBlueBufferSize(format.blueBufferSize());
74  retFormat.setDepth(format.depth());
75  if (format.depthBufferSize() >= 0)
76  retFormat.setDepthBufferSize(format.depthBufferSize());
77  retFormat.setDirectRendering(format.directRendering());
78  retFormat.setDoubleBuffer(format.doubleBuffer());
79  if (format.greenBufferSize() >= 0)
80  retFormat.setGreenBufferSize(format.greenBufferSize());
81  if (format.redBufferSize() >= 0)
82  retFormat.setRedBufferSize(format.redBufferSize());
83  retFormat.setRgba(format.rgba());
84  retFormat.setSampleBuffers(format.sampleBuffers());
85  retFormat.setSamples(format.sampleBuffers());
86  retFormat.setStencil(format.stencil());
87  if (format.stencilBufferSize() >= 0)
88  retFormat.setStencilBufferSize(format.stencilBufferSize());
89  retFormat.setStereo(format.stereo());
90  retFormat.setSwapInterval(format.swapInterval());
91  return retFormat;
92 }
93 
102 QPlatformWindowFormat QGLFormat::toPlatformWindowFormat(const QGLFormat &format)
103 {
104  QPlatformWindowFormat retFormat;
105  retFormat.setAccum(format.accum());
106  if (format.accumBufferSize() >= 0)
107  retFormat.setAccumBufferSize(format.accumBufferSize());
108  retFormat.setAlpha(format.alpha());
109  if (format.alphaBufferSize() >= 0)
110  retFormat.setAlphaBufferSize(format.alphaBufferSize());
111  if (format.blueBufferSize() >= 0)
112  retFormat.setBlueBufferSize(format.blueBufferSize());
113  retFormat.setDepth(format.depth());
114  if (format.depthBufferSize() >= 0)
115  retFormat.setDepthBufferSize(format.depthBufferSize());
116  retFormat.setDirectRendering(format.directRendering());
117  retFormat.setDoubleBuffer(format.doubleBuffer());
118  if (format.greenBufferSize() >= 0)
119  retFormat.setGreenBufferSize(format.greenBufferSize());
120  if (format.redBufferSize() >= 0)
121  retFormat.setRedBufferSize(format.redBufferSize());
122  retFormat.setRgba(format.rgba());
123  retFormat.setSampleBuffers(format.sampleBuffers());
124  if (format.samples() >= 0)
125  retFormat.setSamples(format.samples());
126  retFormat.setStencil(format.stencil());
127  if (format.stencilBufferSize() >= 0)
128  retFormat.setStencilBufferSize(format.stencilBufferSize());
129  retFormat.setStereo(format.stereo());
130  retFormat.setSwapInterval(format.swapInterval());
131  return retFormat;
132 }
133 
134 void QGLContextPrivate::setupSharing() {
135  Q_Q(QGLContext);
136  QPlatformGLContext *sharedPlatformGLContext = platformContext->platformWindowFormat().sharedGLContext();
137  if (sharedPlatformGLContext) {
138  QGLContext *actualSharedContext = QGLContext::fromPlatformGLContext(sharedPlatformGLContext);
139  sharing = true;
140  QGLContextGroup::addShare(q,actualSharedContext);
141  }
142 }
143 
145 {
146  return QApplicationPrivate::platformIntegration()
147  ->hasCapability(QPlatformIntegration::OpenGL);
148 }
149 
150 void qDeleteQGLContext(void *handle)
151 {
152  QGLContext *context = static_cast<QGLContext *>(handle);
153  delete context;
154 }
155 
156 bool QGLContext::chooseContext(const QGLContext* shareContext)
157 {
158  Q_D(QGLContext);
159  if(!d->paintDevice || d->paintDevice->devType() != QInternal::Widget) {
160  d->valid = false;
161  }else {
162  QWidget *widget = static_cast<QWidget *>(d->paintDevice);
163  if (!widget->platformWindow()){
164  QGLFormat glformat = format();
165  QPlatformWindowFormat winFormat = QGLFormat::toPlatformWindowFormat(glformat);
166  if (shareContext) {
167  winFormat.setSharedContext(shareContext->d_func()->platformContext);
168  }
170  winFormat.setAlpha(true);
172  winFormat.setWindowSurface(false);
173  widget->setPlatformWindowFormat(winFormat);
174  widget->winId();//make window
175  }
176  d->platformContext = widget->platformWindow()->glContext();
177  Q_ASSERT(d->platformContext);
178  d->glFormat = QGLFormat::fromPlatformWindowFormat(d->platformContext->platformWindowFormat());
179  d->valid =(bool) d->platformContext;
180  if (d->valid) {
181  d->platformContext->setQGLContextHandle(this,qDeleteQGLContext);
182  }
183  d->setupSharing();
184  }
185 
186 
187  return d->valid;
188 }
189 
190 void QGLContext::reset()
191 {
192  Q_D(QGLContext);
193  if (!d->valid)
194  return;
195  d->cleanup();
196 
197  d->crWin = false;
198  d->sharing = false;
199  d->valid = false;
200  d->transpColor = QColor();
201  d->initDone = false;
203  if (d->platformContext) {
204  d->platformContext->setQGLContextHandle(0,0);
205  }
206 }
207 
209 {
210  Q_D(QGLContext);
211  d->platformContext->makeCurrent();
212 
213  if (!d->workaroundsCached) {
214  d->workaroundsCached = true;
215  const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
216  if (renderer && strstr(renderer, "Mali")) {
217  d->workaround_brokenFBOReadBack = true;
218  }
219  }
220 
221 }
222 
224 {
225  Q_D(QGLContext);
226  d->platformContext->doneCurrent();
227 }
228 
229 void QGLContext::swapBuffers() const
230 {
231  Q_D(const QGLContext);
232  d->platformContext->swapBuffers();
233 }
234 
235 void *QGLContext::getProcAddress(const QString &procName) const
236 {
237  Q_D(const QGLContext);
238  return d->platformContext->getProcAddress(procName);
239 }
240 
241 void QGLWidget::setContext(QGLContext *context,
242  const QGLContext* shareContext,
243  bool deleteOldContext)
244 {
245  Q_D(QGLWidget);
246  if (context == 0) {
247  qWarning("QGLWidget::setContext: Cannot set null context");
248  return;
249  }
250 
251  if (context->device() == 0) // a context may refere to more than 1 window.
252  context->setDevice(this); //but its better to point to 1 of them than none of them.
253 
254  QGLContext* oldcx = d->glcx;
255  d->glcx = context;
256 
257  if (!d->glcx->isValid())
258  d->glcx->create(shareContext ? shareContext : oldcx);
259 
260  if (deleteOldContext)
261  delete oldcx;
262 }
263 
264 void QGLWidgetPrivate::init(QGLContext *context, const QGLWidget *shareWidget)
265 {
266  initContext(context, shareWidget);
267 }
268 
270 {
271  return false;
272 }
273 
275 {
276  return QColor(); // Invalid color
277 }
278 
279 uint QGLContext::colorIndex(const QColor&) const
280 {
281  return 0;
282 }
283 
284 void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase)
285 {
286  Q_UNUSED(fnt);
287  Q_UNUSED(listBase);
288 }
289 
290 /*
291  QGLTemporaryContext implementation
292 */
294 {
295 public:
298 };
299 
302 {
303  d->context = const_cast<QPlatformGLContext *>(QPlatformGLContext::currentContext());
304  if (d->context)
305  d->context->doneCurrent();
306  d->widget = new QWidget;
307  d->widget->setGeometry(0,0,3,3);
308  QPlatformWindowFormat format = d->widget->platformWindowFormat();
310  format.setWindowSurface(false);
311  d->widget->setPlatformWindowFormat(format);
312  d->widget->winId();
313 
314  d->widget->platformWindow()->glContext()->makeCurrent();
315 }
316 
318 {
319  d->widget->platformWindow()->glContext()->doneCurrent();
320  if (d->context)
321  d->context->makeCurrent();
322  delete d->widget;
323 }
324 
325 
327 {
328  return false;
329 }
330 
339 {
340 }
341 
342 void QGLWidget::setMouseTracking(bool enable)
343 {
344  Q_UNUSED(enable);
345 }
346 
348 {
349  return QWidget::event(e);
350 }
351 
353 {
354  Q_D(QGLWidget);
355 
357  if (!isValid())
358  return;
359  makeCurrent();
360  if (!d->glcx->initialized())
361  glInit();
362  resizeGL(width(), height());
363 }
364 
365 
367 {
368  return 0;
369 }
370 
372 {
373 }
374 
375 
377 {
378 }
379 
380 const QGLColormap & QGLWidget::colormap() const
381 {
382  Q_D(const QGLWidget);
383  return d->cmap;
384 }
385 
387 {
388  Q_UNUSED(c);
389 }
390 
392  : d_ptr(new QGLContextPrivate(this))
393 {
394  Q_D(QGLContext);
395  d->init(0,QGLFormat::fromPlatformWindowFormat(platformContext->platformWindowFormat()));
396  d->platformContext = platformContext;
397  d->platformContext->setQGLContextHandle(this,qDeleteQGLContext);
398  d->valid = true;
399  d->setupSharing();
400 }
401 
411 QGLContext *QGLContext::fromPlatformGLContext(QPlatformGLContext *platformContext)
412 {
413  if (!platformContext)
414  return 0;
415  if (platformContext->qGLContextHandle()) {
416  return reinterpret_cast<QGLContext *>(platformContext->qGLContextHandle());
417  }
418  QGLContext *glContext = new QGLContext(platformContext);
419  //Don't call create on context. This can cause the platformFormat to be set on the widget, which
420  //will cause the platformWindow to be recreated.
421  return glContext;
422 }
423 
static const QPlatformGLContext * currentContext()
Returns the last context which called makeCurrent.
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
double d
Definition: qnumeric_p.h:62
virtual void swapBuffers() const
Swaps the screen contents with an off-screen buffer.
Definition: qgl_egl.cpp:287
static void addShare(const QGLContext *context, const QGLContext *share)
Definition: qgl.cpp:5846
void setSharedContext(QPlatformGLContext *context)
int greenBufferSize() const
Returns the green buffer size.
void setSamples(int numSamples)
Set the preferred number of samples per pixel when multisampling is enabled to numSamples.
Definition: qgl.cpp:836
void setStencil(bool enable)
If enable is true enables the stencil buffer; otherwise disables the stencil buffer.
Definition: qgl.cpp:724
bool rgba() const
Returns true if RGBA color mode is set.
Definition: qgl.h:623
unsigned char c[8]
Definition: qnumeric_p.h:62
int swapInterval() const
Returns the currently set swap interval.
void setAccumBufferSize(int size)
Set the preferred accumulation buffer size, where size is the bit depth for each RGBA component...
Definition: qgl.cpp:1143
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
bool rgba() const
Returns true if RGBA color mode is set.
QPointer< QWidget > widget
void setSwapInterval(int interval)
Set the preferred swap interval.
void setDepthBufferSize(int size)
Set the minimum depth buffer size to size.
int greenBufferSize() const
Returns the green buffer size.
Definition: qgl.cpp:1070
void qDeleteQGLContext(void *handle)
Definition: qgl_qpa.cpp:150
void setSwapInterval(int interval)
Set the preferred swap interval.
Definition: qgl.cpp:868
void setStereo(bool enable)
If enable is true enables stereo buffering; otherwise disables stereo buffering.
void setRedBufferSize(int size)
Set the preferred red buffer size to size.
Definition: qgl.cpp:1015
void setDirectRendering(bool enable)
If enable is true enables direct rendering; otherwise disables direct rendering.
void setDevice(QPaintDevice *pDev)
Definition: qgl.cpp:3267
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QPlatformWindowFormat class specifies the display format of an OpenGL rendering context and if po...
QColor overlayTransparentColor() const
If this context is a valid context in an overlay plane, returns the plane&#39;s transparent color...
Definition: qgl_egl.cpp:362
virtual void resizeEvent(QResizeEvent *)
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
Definition: qwidget.cpp:9587
void * getProcAddress(const QString &proc) const
Returns a function pointer to the GL extension function passed in proc.
Definition: qgl_egl.cpp:379
void setAlpha(bool enable)
If enable is true enables the alpha buffer; otherwise disables the alpha buffer.
Definition: qgl.cpp:664
void setBlueBufferSize(int size)
Set the preferred blue buffer size to size.
QGLContext(const QGLFormat &format, QPaintDevice *device)
Constructs an OpenGL context for the given paint device, which can be a widget or a pixmap...
Definition: qgl.cpp:2133
void setStencilBufferSize(int size)
Set the preferred stencil buffer size to size.
void setSampleBuffers(bool enable)
If enable is true, a GL context with multisample buffer support is picked; otherwise ignored...
Definition: qgl.cpp:812
The QString class provides a Unicode character string.
Definition: qstring.h:83
void init(QGLContext *context, const QGLWidget *shareWidget)
Definition: qgl_mac.mm:950
int stencilBufferSize() const
Returns the stencil buffer size.
static void removeShare(const QGLContext *context)
Definition: qgl.cpp:5867
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool doubleBuffer() const
Returns true if double buffering is enabled; otherwise returns false.
int redBufferSize() const
Returns the red buffer size.
Definition: qgl.cpp:1035
#define Q_D(Class)
Definition: qglobal.h:2482
bool stereo() const
Returns true if stereo buffering is enabled; otherwise returns false.
bool directRendering() const
Returns true if direct rendering is enabled; otherwise returns false.
Definition: qgl.h:648
#define Q_Q(Class)
Definition: qglobal.h:2483
void setDirectRendering(bool enable)
If enable is true enables direct rendering; otherwise disables direct rendering.
Definition: qgl.cpp:787
bool sampleBuffers() const
Returns true if multisample buffer support is enabled; otherwise returns false.
Definition: qgl.h:658
QPlatformGLContext * context
Definition: qgl_qpa.cpp:297
void setAlphaBufferSize(int size)
Set the preferred alpha buffer size to size.
Definition: qgl.cpp:1116
int alphaBufferSize() const
Returns the alpha buffer size.
Definition: qgl.cpp:1132
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
bool depth() const
Returns true if the depth buffer is enabled; otherwise returns false.
Definition: qgl.h:618
QPlatformGLContext * sharedGLContext() const
void generateFontDisplayLists(const QFont &fnt, int listBase)
Generates a set of 256 display lists for the 256 first characters in the font font.
Definition: qgl_egl.cpp:373
int accumBufferSize() const
Returns the accumulation buffer size.
Definition: qgl.cpp:1159
The QGLFormat class specifies the display format of an OpenGL rendering context.
Definition: qgl.h:175
The QGLContext class encapsulates an OpenGL rendering context.
Definition: qgl.h:310
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
int depthBufferSize() const
Returns the depth buffer size.
Definition: qgl.cpp:1000
void setAccumBufferSize(int size)
Set the preferred accumulation buffer size, where size is the bit depth for each RGBA component...
void setAlphaBufferSize(int size)
Set the preferred alpha buffer size to size.
void setDepthBufferSize(int size)
Set the minimum depth buffer size to size.
Definition: qgl.cpp:984
bool stencil() const
Returns true if the stencil buffer is enabled; otherwise returns false.
Definition: qgl.h:638
The QResizeEvent class contains event parameters for resize events.
Definition: qevent.h:349
Q_CORE_EXPORT void qWarning(const char *,...)
void setDoubleBuffer(bool enable)
If enable is true sets double buffering; otherwise sets single buffering.
Definition: qgl.cpp:566
virtual QPlatformWindowFormat platformWindowFormat() const =0
QWidget has the function qplatformWindowFormat().
static bool hasOpenGL()
Returns true if the window system has any OpenGL support; otherwise returns false.
Definition: qgl_egl.cpp:186
unsigned int uint
Definition: qglobal.h:996
int depthBufferSize() const
Returns the depth buffer size.
int alphaBufferSize() const
Returns the alpha buffer size.
void setGreenBufferSize(int size)
Set the preferred green buffer size to size.
Definition: qgl.cpp:1050
int accumBufferSize() const
Returns the accumulation buffer size.
QPaintDevice * device() const
Returns the paint device set for this context.
Definition: qgl.cpp:3507
bool accum() const
Returns true if the accumulation buffer is enabled; otherwise returns false.
Definition: qgl.h:633
void setDepth(bool enable)
If enable is true enables the depth buffer; otherwise disables the depth buffer.
Definition: qgl.cpp:599
void setSamples(int numSamples)
Set the preferred number of samples per pixel when multisampling is enabled to numSamples.
bool depth() const
Returns true if the depth buffer is enabled; otherwise returns false.
void setDoubleBuffer(bool enable)
If enable is true sets double buffering; otherwise sets single buffering.
void setRgba(bool enable)
If enable is true sets RGBA mode.
The QGLColormap class is used for installing custom colormaps into a QGLWidget.
Definition: qglcolormap.h:54
bool accum() const
Returns true if the accumulation buffer is enabled; otherwise returns false.
void setRgba(bool enable)
If enable is true sets RGBA mode.
Definition: qgl.cpp:633
void reset()
Resets the context and makes it invalid.
Definition: qgl_egl.cpp:191
The QGLWidget class is a widget for rendering OpenGL graphics.
Definition: qgl.h:474
virtual bool chooseContext(const QGLContext *shareContext=0)
This semi-internal function is called by create().
Definition: qgl_mac.mm:190
The QPlatformGLContext class provides an abstraction for native GL contexts.
void setAlpha(bool enable)
If enable is true enables the alpha buffer; otherwise disables the alpha buffer.
static bool hasOpenGLOverlays()
Returns true if the window system supports OpenGL overlays; otherwise returns false.
Definition: qgl_mac.mm:185
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
QGLFormatPrivate * d
Definition: qgl.h:290
virtual void doneCurrent()
Makes no GL context the current context.
Definition: qgl_egl.cpp:277
int swapInterval() const
Returns the currently set swap interval.
Definition: qgl.cpp:883
void resizeEvent(QResizeEvent *)
Handles resize events that are passed in the event parameter.
Definition: qgl_mac.mm:896
void setSampleBuffers(bool enable)
If enable is true, a GL context with multisample buffer support is picked; otherwise ignored...
const QGLContext * overlayContext() const
Returns the overlay context of this widget, or 0 if this widget has no overlay.
Definition: qgl_mac.mm:919
void setWindowApi(QPlatformWindowFormat::WindowApi api)
void makeOverlayCurrent()
Makes the overlay context of this widget current.
Definition: qgl_mac.mm:924
#define GL_RENDERER
bool alpha() const
Returns true if the alpha buffer in the framebuffer is enabled; otherwise returns false...
Definition: qgl.h:628
bool stencil() const
Returns true if the stencil buffer is enabled; otherwise returns false.
int blueBufferSize() const
Returns the blue buffer size.
if(void) toggleToolbarShown
void setStencil(bool enable)
If enable is true enables the stencil buffer; otherwise disables the stencil buffer.
virtual void makeCurrent()
Makes this context the current OpenGL rendering context.
Definition: qgl_egl.cpp:213
int blueBufferSize() const
Returns the blue buffer size.
Definition: qgl.cpp:1105
QGLTemporaryContext(bool directRendering=true, QWidget *parent=0)
Definition: qgl_mac.mm:132
bool doubleBuffer() const
Returns true if double buffering is enabled; otherwise returns false.
Definition: qgl.h:613
int redBufferSize() const
Returns the red buffer size.
void setRedBufferSize(int size)
Set the preferred red buffer size to size.
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
bool directRendering() const
Returns true if direct rendering is enabled; otherwise returns false.
uint colorIndex(const QColor &c) const
Returns a colormap index for the color c, in ColorIndex mode.
Definition: qgl_egl.cpp:367
bool alpha() const
Returns true if the alpha buffer in the framebuffer is enabled; otherwise returns false...
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
void setStereo(bool enable)
If enable is true enables stereo buffering; otherwise disables stereo buffering.
Definition: qgl.cpp:754
virtual void updateOverlayGL()
Updates the widget&#39;s overlay (if any).
Definition: qgl_mac.mm:928
bool event(QEvent *)
This is the main event handler; it handles event event.
Definition: qwidget.cpp:8636
const QGLColormap & colormap() const
Returns the colormap for this widget.
Definition: qgl_mac.mm:974
void setColormap(const QGLColormap &map)
Set the colormap for this widget to cmap.
Definition: qgl_mac.mm:979
void setWindowSurface(bool enable)
If enable is true a top level QWidget will create a QWindowSurface at creation;.
void setBlueBufferSize(int size)
Set the preferred blue buffer size to size.
Definition: qgl.cpp:1085
void setMouseTracking(bool enable)
If enable is true then mouse tracking is enabled; otherwise it is disabled.
Definition: qgl_egl.cpp:357
int stencilBufferSize() const
Returns the stencil buffer size.
Definition: qgl.cpp:1185
bool sampleBuffers() const
Returns true if multisample buffer support is enabled; otherwise returns false.
bool stereo() const
Returns true if stereo buffering is enabled; otherwise returns false.
Definition: qgl.h:643
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
void setAccum(bool enable)
If enable is true enables the accumulation buffer; otherwise disables the accumulation buffer...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
void setStencilBufferSize(int size)
Set the preferred stencil buffer size to size.
Definition: qgl.cpp:1169
int samples() const
Returns the number of samples per pixel when multisampling is enabled.
Definition: qgl.cpp:824
void setGreenBufferSize(int size)
Set the preferred green buffer size to size.
void setDepth(bool enable)
If enable is true enables the depth buffer; otherwise disables the depth buffer.
void setAccum(bool enable)
If enable is true enables the accumulation buffer; otherwise disables the accumulation buffer...
Definition: qgl.cpp:694
void setContext(QGLContext *context, const QGLContext *shareContext=0, bool deleteOldContext=true)
Sets a new QGLContext, context, for this QGLWidget, using the shared context, shareContext.
Definition: qgl_mac.mm:932
bool renderCxPm(QPixmap *pixmap)
Definition: qgl_egl.cpp:384
void cleanupColormaps()
Free up any allocated colormaps.
Definition: qgl_mac.mm:970
bool event(QEvent *)
Reimplemented Function
Definition: qgl_qpa.cpp:347