Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QOpenGLFramebufferObjectFormat Class Reference

The QOpenGLFramebufferObjectFormat class specifies the format of an OpenGL framebuffer object. More...

#include <qopenglframebufferobject.h>

+ Collaboration diagram for QOpenGLFramebufferObjectFormat:

Public Member Functions

 QOpenGLFramebufferObjectFormat ()
 Creates a QOpenGLFramebufferObjectFormat object for specifying the format of an OpenGL framebuffer object.
 
 QOpenGLFramebufferObjectFormat (const QOpenGLFramebufferObjectFormat &other)
 Constructs a copy of other.
 
QOpenGLFramebufferObjectFormatoperator= (const QOpenGLFramebufferObjectFormat &other)
 Assigns other to this object.
 
 ~QOpenGLFramebufferObjectFormat ()
 Destroys the QOpenGLFramebufferObjectFormat.
 
void setSamples (int samples)
 Sets the number of samples per pixel for a multisample framebuffer object to samples.
 
int samples () const
 Returns the number of samples per pixel if a framebuffer object is a multisample framebuffer object.
 
void setMipmap (bool enabled)
 Enables mipmapping if enabled is true; otherwise disables it.
 
bool mipmap () const
 Returns true if mipmapping is enabled.
 
void setAttachment (QOpenGLFramebufferObject::Attachment attachment)
 Sets the attachment configuration of a framebuffer object to attachment.
 
QOpenGLFramebufferObject::Attachment attachment () const
 Returns the configuration of the depth and stencil buffers attached to a framebuffer object.
 
void setTextureTarget (GLenum target)
 Sets the texture target of the texture attached to a framebuffer object to target.
 
GLenum textureTarget () const
 Returns the texture target of the texture attached to a framebuffer object.
 
void setInternalTextureFormat (GLenum internalTextureFormat)
 Sets the internal format of a framebuffer object's texture or multisample framebuffer object's color buffer to internalTextureFormat.
 
GLenum internalTextureFormat () const
 Returns the internal format of a framebuffer object's texture or multisample framebuffer object's color buffer.
 
bool operator== (const QOpenGLFramebufferObjectFormat &other) const
 Returns true if all the options of this framebuffer object format are the same as other; otherwise returns false.
 
bool operator!= (const QOpenGLFramebufferObjectFormat &other) const
 Returns false if all the options of this framebuffer object format are the same as other; otherwise returns true.
 

Detailed Description

The QOpenGLFramebufferObjectFormat class specifies the format of an OpenGL framebuffer object.

\inmodule QtOpenGL

Since
5.0

A framebuffer object has several characteristics: \list

Note that the desired attachments or number of samples per pixels might not be supported by the hardware driver. Call QOpenGLFramebufferObject::format() after creating a QOpenGLFramebufferObject to find the exact format that was used to create the frame buffer object.

See also
QOpenGLFramebufferObject

Definition at line 125 of file qopenglframebufferobject.h.

Constructor & Destructor Documentation

◆ QOpenGLFramebufferObjectFormat() [1/2]

QOpenGLFramebufferObjectFormat::QOpenGLFramebufferObjectFormat ( )

Creates a QOpenGLFramebufferObjectFormat object for specifying the format of an OpenGL framebuffer object.

By default the format specifies a non-multisample framebuffer object with no depth/stencil attachments, texture target GL_TEXTURE_2D, and internal format GL_RGBA8. On OpenGL/ES systems, the default internal format is GL_RGBA.

See also
samples(), attachment(), internalTextureFormat()

Definition at line 200 of file qopenglframebufferobject.cpp.

◆ QOpenGLFramebufferObjectFormat() [2/2]

QOpenGLFramebufferObjectFormat::QOpenGLFramebufferObjectFormat ( const QOpenGLFramebufferObjectFormat & other)

Constructs a copy of other.

Definition at line 209 of file qopenglframebufferobject.cpp.

◆ ~QOpenGLFramebufferObjectFormat()

QOpenGLFramebufferObjectFormat::~QOpenGLFramebufferObjectFormat ( )

Destroys the QOpenGLFramebufferObjectFormat.

Definition at line 233 of file qopenglframebufferobject.cpp.

Member Function Documentation

◆ attachment()

QOpenGLFramebufferObject::Attachment QOpenGLFramebufferObjectFormat::attachment ( ) const

Returns the configuration of the depth and stencil buffers attached to a framebuffer object.

The default is QOpenGLFramebufferObject::NoAttachment.

See also
setAttachment()

Definition at line 315 of file qopenglframebufferobject.cpp.

◆ internalTextureFormat()

GLenum QOpenGLFramebufferObjectFormat::internalTextureFormat ( ) const

Returns the internal format of a framebuffer object's texture or multisample framebuffer object's color buffer.

The default is GL_RGBA8 on desktop OpenGL systems, and GL_RGBA on OpenGL/ES systems.

See also
setInternalTextureFormat()

Definition at line 365 of file qopenglframebufferobject.cpp.

◆ mipmap()

bool QOpenGLFramebufferObjectFormat::mipmap ( ) const

Returns true if mipmapping is enabled.

See also
setMipmap()

Definition at line 293 of file qopenglframebufferobject.cpp.

◆ operator!=()

bool QOpenGLFramebufferObjectFormat::operator!= ( const QOpenGLFramebufferObjectFormat & other) const

Returns false if all the options of this framebuffer object format are the same as other; otherwise returns true.

Definition at line 386 of file qopenglframebufferobject.cpp.

◆ operator=()

QOpenGLFramebufferObjectFormat & QOpenGLFramebufferObjectFormat::operator= ( const QOpenGLFramebufferObjectFormat & other)

Assigns other to this object.

Definition at line 219 of file qopenglframebufferobject.cpp.

◆ operator==()

bool QOpenGLFramebufferObjectFormat::operator== ( const QOpenGLFramebufferObjectFormat & other) const

Returns true if all the options of this framebuffer object format are the same as other; otherwise returns false.

Definition at line 374 of file qopenglframebufferobject.cpp.

◆ samples()

int QOpenGLFramebufferObjectFormat::samples ( ) const

Returns the number of samples per pixel if a framebuffer object is a multisample framebuffer object.

Otherwise, returns 0. The default value is 0.

See also
setSamples()

Definition at line 265 of file qopenglframebufferobject.cpp.

◆ setAttachment()

void QOpenGLFramebufferObjectFormat::setAttachment ( QOpenGLFramebufferObject::Attachment attachment)

Sets the attachment configuration of a framebuffer object to attachment.

See also
attachment()

Definition at line 303 of file qopenglframebufferobject.cpp.

◆ setInternalTextureFormat()

void QOpenGLFramebufferObjectFormat::setInternalTextureFormat ( GLenum internalTextureFormat)

Sets the internal format of a framebuffer object's texture or multisample framebuffer object's color buffer to internalTextureFormat.

See also
internalTextureFormat()

Definition at line 351 of file qopenglframebufferobject.cpp.

◆ setMipmap()

void QOpenGLFramebufferObjectFormat::setMipmap ( bool enabled)

Enables mipmapping if enabled is true; otherwise disables it.

Mipmapping is disabled by default.

If mipmapping is enabled, additional memory will be allocated for the mipmap levels. The mipmap levels can be updated by binding the texture and calling glGenerateMipmap(). Mipmapping cannot be enabled for multisampled framebuffer objects.

See also
mipmap(), QOpenGLFramebufferObject::texture()

Definition at line 282 of file qopenglframebufferobject.cpp.

◆ setSamples()

void QOpenGLFramebufferObjectFormat::setSamples ( int samples)

Sets the number of samples per pixel for a multisample framebuffer object to samples.

The default sample count of 0 represents a regular non-multisample framebuffer object.

If the desired amount of samples per pixel is not supported by the hardware then the maximum number of samples per pixel will be used. Note that multisample framebuffer objects cannot be bound as textures. Also, the {GL_EXT_framebuffer_multisample} extension is required to create a framebuffer with more than one sample per pixel.

See also
samples()

Definition at line 252 of file qopenglframebufferobject.cpp.

◆ setTextureTarget()

void QOpenGLFramebufferObjectFormat::setTextureTarget ( GLenum target)

Sets the texture target of the texture attached to a framebuffer object to target.

Ignored for multisample framebuffer objects.

See also
textureTarget(), samples()

Definition at line 326 of file qopenglframebufferobject.cpp.

◆ textureTarget()

GLenum QOpenGLFramebufferObjectFormat::textureTarget ( ) const

Returns the texture target of the texture attached to a framebuffer object.

Ignored for multisample framebuffer objects. The default is GL_TEXTURE_2D.

See also
setTextureTarget(), samples()

Definition at line 339 of file qopenglframebufferobject.cpp.


The documentation for this class was generated from the following files: