QOpenGLFramebufferObjectFormat 类

QOpenGLFramebufferObjectFormat 类指定 OpenGL 帧缓冲对象的格式。 更多...

头: #include <QOpenGLFramebufferObjectFormat>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpenGL)
target_link_libraries(mytarget PRIVATE Qt6::OpenGL)
qmake: QT += opengl

公共函数

QOpenGLFramebufferObjectFormat ()
QOpenGLFramebufferObjectFormat (const QOpenGLFramebufferObjectFormat & other )
~QOpenGLFramebufferObjectFormat ()
QOpenGLFramebufferObject::Attachment attachment () const
GLenum internalTextureFormat () const
bool mipmap () const
int samples () const
void setAttachment (QOpenGLFramebufferObject::Attachment attachment )
void setInternalTextureFormat (GLenum internalTextureFormat )
void setMipmap (bool enabled )
void setSamples (int samples )
void setTextureTarget (GLenum target )
GLenum textureTarget () const
bool operator!= (const QOpenGLFramebufferObjectFormat & other ) const
QOpenGLFramebufferObjectFormat & operator= (const QOpenGLFramebufferObjectFormat & other )
bool operator== (const QOpenGLFramebufferObjectFormat & other ) const

详细描述

A framebuffer object has several characteristics:

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.

另请参阅 QOpenGLFramebufferObject .

成员函数文档编制

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 .

另请参阅 samples (), attachment (),和 internalTextureFormat ().

QOpenGLFramebufferObjectFormat:: QOpenGLFramebufferObjectFormat (const QOpenGLFramebufferObjectFormat & other )

构造副本为 other .

QOpenGLFramebufferObjectFormat:: ~QOpenGLFramebufferObjectFormat ()

销毁 QOpenGLFramebufferObjectFormat .

QOpenGLFramebufferObject::Attachment QOpenGLFramebufferObjectFormat:: attachment () const

Returns the configuration of the depth and stencil buffers attached to a framebuffer object. The default is QOpenGLFramebufferObject::NoAttachment .

另请参阅 setAttachment ().

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.

另请参阅 setInternalTextureFormat ().

bool QOpenGLFramebufferObjectFormat:: mipmap () const

返回 true if mipmapping is enabled.

另请参阅 setMipmap ().

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.

另请参阅 setSamples ().

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

Sets the attachment configuration of a framebuffer object to attachment .

另请参阅 attachment ().

void QOpenGLFramebufferObjectFormat:: setInternalTextureFormat ( GLenum internalTextureFormat )

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

另请参阅 internalTextureFormat ().

void QOpenGLFramebufferObjectFormat:: setMipmap ( bool enabled )

Enables mipmapping if enabled 为 true;否则禁用它。

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.

另请参阅 mipmap () 和 QOpenGLFramebufferObject::texture ().

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.

另请参阅 samples ().

void QOpenGLFramebufferObjectFormat:: setTextureTarget ( GLenum target )

Sets the texture target of the texture attached to a framebuffer object to target . Ignored for multisample framebuffer objects.

另请参阅 textureTarget () 和 samples ().

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 .

另请参阅 setTextureTarget () 和 samples ().

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

返回 false if all the options of this framebuffer object format are the same as other ;否则返回 true .

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

赋值 other 到此对象。

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

返回 true if all the options of this framebuffer object format are the same as other ;否则返回 false .