Qt 4.8
Enumerations | Functions
QGL Namespace Reference

The QGL namespace specifies miscellaneous identifiers used in the Qt OpenGL module. More...

Enumerations

enum  FormatOption {
  DoubleBuffer = 0x0001, DepthBuffer = 0x0002, Rgba = 0x0004, AlphaChannel = 0x0008,
  AccumBuffer = 0x0010, StencilBuffer = 0x0020, StereoBuffers = 0x0040, DirectRendering = 0x0080,
  HasOverlay = 0x0100, SampleBuffers = 0x0200, DeprecatedFunctions = 0x0400, SingleBuffer = DoubleBuffer << 16,
  NoDepthBuffer = DepthBuffer << 16, ColorIndex = Rgba << 16, NoAlphaChannel = AlphaChannel << 16, NoAccumBuffer = AccumBuffer << 16,
  NoStencilBuffer = StencilBuffer << 16, NoStereoBuffers = StereoBuffers << 16, IndirectRendering = DirectRendering << 16, NoOverlay = HasOverlay << 16,
  NoSampleBuffers = SampleBuffers << 16, NoDeprecatedFunctions = DeprecatedFunctions << 16
}
 This enum specifies the format options that can be used to configure an OpenGL context. More...
 

Functions

Q_OPENGL_EXPORT void setPreferredPaintEngine (QPaintEngine::Type engineType)
 Sets the preferred OpenGL paint engine that is used to draw onto QGLWidget, QGLPixelBuffer and QGLFramebufferObject targets with QPainter in Qt. More...
 

Detailed Description

The QGL namespace specifies miscellaneous identifiers used in the Qt OpenGL module.

Attention
Module: QtOpenGL

Enumeration Type Documentation

◆ FormatOption

This enum specifies the format options that can be used to configure an OpenGL context.

These are set using QGLFormat::setOption().

  • DoubleBuffer Specifies the use of double buffering.
  • DepthBuffer Enables the use of a depth buffer.
  • Rgba Specifies that the context should use RGBA as its pixel format.
  • AlphaChannel Enables the use of an alpha channel.
  • AccumBuffer Enables the use of an accumulation buffer.
  • StencilBuffer Enables the use of a stencil buffer.
  • StereoBuffers Enables the use of a stereo buffers for use with visualization hardware.
  • DirectRendering Specifies that the context is used for direct rendering to a display.
  • HasOverlay Enables the use of an overlay.
  • SampleBuffers Enables the use of sample buffers.
  • DeprecatedFunctions Enables the use of deprecated functionality for OpenGL 3.x contexts. A context with deprecated functionality enabled is called a full context in the OpenGL specification.
  • SingleBuffer Specifies the use of a single buffer, as opposed to double buffers.
  • NoDepthBuffer Disables the use of a depth buffer.
  • ColorIndex Specifies that the context should use a color index as its pixel format.
  • NoAlphaChannel Disables the use of an alpha channel.
  • NoAccumBuffer Disables the use of an accumulation buffer.
  • NoStencilBuffer Disables the use of a stencil buffer.
  • NoStereoBuffers Disables the use of stereo buffers.
  • IndirectRendering Specifies that the context is used for indirect rendering to a buffer.
  • NoOverlay Disables the use of an overlay.
  • NoSampleBuffers Disables the use of sample buffers.
  • NoDeprecatedFunctions Disables the use of deprecated functionality for OpenGL 3.x contexts. A context with deprecated functionality disabled is called a forward compatible context in the OpenGL specification.
See also
{Sample Buffers Example}
Enumerator
DoubleBuffer 
DepthBuffer 
Rgba 
AlphaChannel 
AccumBuffer 
StencilBuffer 
StereoBuffers 
DirectRendering 
HasOverlay 
SampleBuffers 
DeprecatedFunctions 
SingleBuffer 
NoDepthBuffer 
ColorIndex 
NoAlphaChannel 
NoAccumBuffer 
NoStencilBuffer 
NoStereoBuffers 
IndirectRendering 
NoOverlay 
NoSampleBuffers 
NoDeprecatedFunctions 

Definition at line 144 of file qgl.h.

144  {
145  DoubleBuffer = 0x0001,
146  DepthBuffer = 0x0002,
147  Rgba = 0x0004,
148  AlphaChannel = 0x0008,
149  AccumBuffer = 0x0010,
150  StencilBuffer = 0x0020,
151  StereoBuffers = 0x0040,
152  DirectRendering = 0x0080,
153  HasOverlay = 0x0100,
154  SampleBuffers = 0x0200,
155  DeprecatedFunctions = 0x0400,
156  SingleBuffer = DoubleBuffer << 16,
157  NoDepthBuffer = DepthBuffer << 16,
158  ColorIndex = Rgba << 16,
160  NoAccumBuffer = AccumBuffer << 16,
164  NoOverlay = HasOverlay << 16,
167  };
Definition: qgl.h:147

Function Documentation

◆ setPreferredPaintEngine()

void QGL::setPreferredPaintEngine ( QPaintEngine::Type  engineType)

Sets the preferred OpenGL paint engine that is used to draw onto QGLWidget, QGLPixelBuffer and QGLFramebufferObject targets with QPainter in Qt.

Since
4.6

The engineType parameter specifies which of the GL engines to use. Only QPaintEngine::OpenGL and QPaintEngine::OpenGL2 are valid parameters to this function. All other values are ignored.

By default, the QPaintEngine::OpenGL2 engine is used if GL/GLES version 2.0 is available, otherwise QPaintEngine::OpenGL is used.

Warning
This function must be called before the QApplication constructor is called.

Definition at line 299 of file qgl.cpp.

Referenced by QGLGraphicsSystemPlugin::create().

300 {
301  qgl_engine_selector()->setPreferredPaintEngine(engineType);
302 }