Qt3D Reference Documentation

QGL Namespace

The QGL namespace contains miscellaneous identifiers used throughout the Qt3D module. More...

 #include <QGL>

Types

enum DrawingMode { Points, Lines, LineLoop, LineStrip, ..., TriangleStripAdjacency }
enum Eye { NoEye, LeftEye, RightEye }
enum Face { FrontFaces, BackFaces, AllFaces }
typedef IndexArray
enum Mouse3DKeys { Key_Fit, Key_TopView, Key_LeftView, Key_RightView, ..., Key_DecreaseSensitivity }
enum Smoothing { NoSmoothing, Smooth, Faceted }
enum StandardEffect { FlatColor, FlatPerVertexColor, FlatReplaceTexture2D, FlatDecalTexture2D, ..., LitModulateTexture2D }
enum TextureWrap { Repeat, Clamp, ClampToBorder, ClampToEdge, MirroredRepeat }
enum VertexAttribute { Position, Normal, Color, TextureCoord0, ..., UserVertex }

Functions

quint32 fieldMask ( QGL::VertexAttribute attribute )
int nextPowerOfTwo ( int value )
QSize nextPowerOfTwo ( const QSize & value )

Detailed Description

The QGL namespace contains miscellaneous identifiers used throughout the Qt3D module.

Type Documentation

enum QGL::DrawingMode

This enum defines the type of OpenGL primitive to render with QGLPainter::draw().

ConstantValueDescription
QGL::Points0x0000Draws a point at each of the specified vertices.
QGL::Lines0x0001Draws a series of unconnected line segments, using two vertices for each line.
QGL::LineLoop0x0002series of connected line segments, from the first to the last vertex, and then connecting the last vertex back to the first vertex.
QGL::LineStrip0x0003Draws a series of connected line segments, from the first to the last vertex.
QGL::Triangles0x0004Draws a series of triangles using three vertices from the enabled vertex arrays for each triangle.
QGL::TriangleStrip0x0005Draws a series of triangles in a strip, starting with the first three vertices and then one extra vertex for each additional triangle.
QGL::TriangleFan0x0006Draws a series of triangles that fan out around the first vertex in the enabled vertex arrays, starting with the first three vertices and then one extra vertex for each additional triangle.
QGL::LinesAdjacency0x000ADraws a series of unconnected lines, using two vertices for each line to define the positions, and an additional vertices per line to define adjacent points. This drawing mode is only supported on OpenGL systems that have geometry shaders.
QGL::LineStripAdjacency0x000BDraws a series of connected line segments, from the second to the second last vertex. The first and last vertices define adjacent points. This drawing mode is only supported on OpenGL systems that have geometry shaders.
QGL::TrianglesAdjacency0x000CDraws a series of triangles using three vertices from the enabled vertex arrays for each triangle. An additional three vertices per triangle are supplied to define adjacent points. This drawing mode is only supported on OpenGL systems that have geometry shaders.
QGL::TriangleStripAdjacency0x000DDraws a series of triangles in a strip, with additional vertices for points adjacent to the strip. This drawing mode is only supported on OpenGL systems that have geometry shaders.

This enum was introduced or modified in Qt3D 4.8.

enum QGL::Eye

This enum defines the eye that is being rendered by a QGLPainter when stereo rendering is in effect.

ConstantValueDescription
QGL::NoEye0Do not perform an eye adjustment on the camera because stereo rendering is not in effect.
QGL::LeftEye1Render the scene from the perspective of the left eye.
QGL::RightEye2Render the scene from the perspective of the right eye.

This enum was introduced or modified in Qt3D 4.8.

enum QGL::Face

This enum defines the faces to apply an operation to.

ConstantValueDescription
QGL::FrontFaces0x0404Apply the operation to front faces only.
QGL::BackFaces0x0405Apply the operation to back faces only.
QGL::AllFaces0x0408Apply the operation to both front and back faces.

This enum was introduced or modified in Qt3D 4.8.

typedef QGL::IndexArray

This is a convenience for either QArray<ushort> (OpenGL/ES) or QArray<int> (desktop OpenGL).

enum QGL::Mouse3DKeys

This enum defines extra key codes for QKeyEvent related to 3D mice devices. See QMouse3DEventProvider for further details.

ConstantValueDescription
QGL::Key_Fit0x01200002Reset the transform so the model is centered to fit within the view.
QGL::Key_TopView0x01200003Switch to the top view.
QGL::Key_LeftView0x01200004Switch to the left view.
QGL::Key_RightView0x01200005Switch to the right view.
QGL::Key_FrontView0x01200006Switch to the front view.
QGL::Key_BottomView0x01200007Switch to the bottom view.
QGL::Key_BackView0x01200008Switch to the back view.
QGL::Key_RotateCW900x01200009Rotate clockwise by 90 degrees.
QGL::Key_RotateCCW900x0120000aRotate counter-clockwise by 90 degrees.
QGL::Key_ISO10x0120000bShow an isometric view of the model with top, front, and right sides.
QGL::Key_ISO20x0120000cShow an isometric view of the model with top, back and left sides.
QGL::Key_Button10x0120000dSpecial function button 1.
QGL::Key_Button20x0120000eSpecial function button 2.
QGL::Key_Button30x0120000fSpecial function button 3.
QGL::Key_Button40x01200010Special function button 4.
QGL::Key_Button50x01200011Special function button 5.
QGL::Key_Button60x01200012Special function button 6.
QGL::Key_Button70x01200013Special function button 7.
QGL::Key_Button80x01200014Special function button 8.
QGL::Key_Button90x01200015Special function button 9.
QGL::Key_Button100x01200016Special function button 10.
QGL::Key_Rotations0x0120001bToggles whether or not the rotation axes on a 3D mouse will be filtered.
QGL::Key_Translations0x0120001cToggles whether or not the translation axes on a 3D mouse will be filtered.
QGL::Key_DominantAxis0x0120001dToggles whether or not 3D mouse movements should be constrained to the dominant axis.
QGL::Key_IncreaseSensitivity0x0120001eIncrease the sensitivity of the mouse to wrist movements.
QGL::Key_DecreaseSensitivity0x0120001fDecrease the sensitivity of the mouse to wrist movements.

This enum was introduced or modified in Qt3D 4.8.

enum QGL::Smoothing

This enum defines vertex smoothing treatments.

ConstantValueDescription
QGL::NoSmoothing0No smoothing processing is performed.
QGL::Smooth1Lighting normals averaged for each face for a smooth appearance.
QGL::Faceted2Lighting normals separate for each face for a faceted appearance.

This enum was introduced or modified in Qt3D 4.8.

enum QGL::StandardEffect

This enum defines a standard drawing effect for use with QGLPainter.

ConstantValueDescription
QGL::FlatColor0Single flat color specified by QGLPainter::setColor() with no lighting.
QGL::FlatPerVertexColor1Per-vertex flat colors specified by a QGL::Color vertex array with no lighting.
QGL::FlatReplaceTexture2D2Map a texture across the fragments with no lighting. The final fragment color is replaced directly with the texture. The texture is sourced from texture unit 0.
QGL::FlatDecalTexture2D3Map a texture across the fragments, combined with QGLPainter::color(), and no lighting. The texture is sourced from texture unit 0.
QGL::LitMaterial4Material colors specified by QGLPainter::setFaceMaterial() with lighting enabled. It is assumed that per-vertex normals are provided. Under OpenGL/ES 2.0 only one light is supported, with single-sided materials, and no attenuation.
QGL::LitDecalTexture2D5Map a texture across the fragments, combined with the material color specified by QGLPainter::setFaceMaterial(), and lighting using the GL_DECAL combination rule. The texture is sourced from texture unit 0. It is assumed that per-vertex normals are provided. Under OpenGL/ES 2.0 only one light is supported, with single-sided materials, and no attenuation.
QGL::LitModulateTexture2D6Map a texture across the fragments, combined with the material color specified by QGLPainter::setFaceMaterial(), and lighting using the GL_MODULATE combination rule. The texture is sourced from texture unit 0. It is assumed that per-vertex normals are provided. Under OpenGL/ES 2.0 only one light is supported, with single-sided materials, and no attenuation.

This enum was introduced or modified in Qt3D 4.8.

enum QGL::TextureWrap

This enum defines the wrapping mode for texture co-ordinates.

ConstantValueDescription
QGL::Repeat0x2901Ignore the integer part of the texture co-ordinate and create a repeating pattern using the texture.
QGL::Clamp0x2900Clamps the texture co-ordinate to the range 0 to 1. This value is not supported in OpenGL/ES, where it will be treated the same as ClampToEdge.
QGL::ClampToBorder0x812DClamps the texture co-ordinate to the range (-1 / 2N) to (1 + 1 / 2N) where N is the size of the texture in the direction of clamping. This value is supported in OpenGL 1.3 and higher. In OpenGL versions less than 1.3, this value will be treated the same as Clamp. In OpenGL/ES, this value will be treated the same as ClampToEdge.
QGL::ClampToEdge0x812FClamps the texture co-ordinate to the range (1 / 2N) to (1 - 1 / 2N) where N is the size of the texture in the direction of clamping. This value is supported in OpenGL 1.2 and higher, and in all versions of OpenGL/ES. In OpenGL versions less than 1.2, this value will be treated the same as Clamp.
QGL::MirroredRepeat0x8370If the integer part of the texture co-ordinate is even, then use the fractional part. If the integer part of the texture co-ordinate is odd, then use 1 - the fractional part. This creates an alternating repeating pattern from the texture. This value is only supported in OpenGL 1.4 and higher, or OpenGL/ES 2.0 and higher. On other versions, MirroredRepeat will be treated the same as Repeat.

This enum was introduced or modified in Qt3D 4.8.

enum QGL::VertexAttribute

This enum defines the type of vertex attribute to set on an effect with QGLPainter::setVertexAttribute()

ConstantValueDescription
QGL::Position0The primary position of the vertex.
QGL::Normal1The normal at each vertex.
QGL::Color2The color at each vertex.
QGL::TextureCoord03The texture co-ordinate at each vertex for texture unit 0.
QGL::TextureCoord14The texture co-ordinate at each vertex for texture unit 1.
QGL::TextureCoord25The texture co-ordinate at each vertex for texture unit 2.
QGL::CustomVertex06First custom vertex attribute. Custom attributes can be used for any purpose: texture co-ordinates, colors, or other values of interest to shader programs.
QGL::CustomVertex17Second custom vertex attribute.
QGL::UserVertex8First user-assigned vertex attribute. Additional attributes can be assigned as UserVertex, UserVertex + 1, etc. Note that on OpenGL/ES 2.0 systems, usually the maximum number of vertex attributes is 8, which means that user-assigned vertex attributes will be out of range.

This enum was introduced or modified in Qt3D 4.8.

Function Documentation

quint32 QGL::fieldMask ( QGL::VertexAttribute attribute )

Returns an unsigned integer mask from the attribute.

See also QGeometryData::fields().

int QGL::nextPowerOfTwo ( int value )

Returns the next power of two that is greater than or equal to value. The value must be positive or the result is undefined.

This is a convenience function for use with GL texture handling code.

QSize QGL::nextPowerOfTwo ( const QSize & value )

Returns the next power of two that is greater than or equal to the width and height components of value.

This is a convenience function for use with GL texture handling code.