In questa pagina

QOpenGLFramebufferObjectFormat Class

La classe QOpenGLFramebufferObjectFormat definisce il formato di un oggetto framebuffer OpenGL. Per saperne di più...

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

Funzioni pubbliche

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

Descrizione dettagliata

Un oggetto framebuffer presenta diverse caratteristiche:

Si noti che gli allegati desiderati o il numero di campioni per pixel potrebbero non essere supportati dal driver hardware. Chiamare QOpenGLFramebufferObject::format() dopo aver creato un oggetto QOpenGLFramebufferObject per individuare il formato esatto utilizzato per creare l’oggetto framebuffer.

Vedi anche QOpenGLFramebufferObject.

Documentazione delle funzioni membro

QOpenGLFramebufferObjectFormat::QOpenGLFramebufferObjectFormat()

Crea un oggetto `QOpenGLFramebufferObjectFormat` per specificare il formato di un oggetto framebuffer OpenGL.

Per impostazione predefinita, il formato specifica un oggetto framebuffer non multisample senza allegati di profondità/stencil, con target di texture GL_TEXTURE_2D e formato interno GL_RGBA8. Sui sistemi OpenGL/ES, il formato interno predefinito è GL_RGBA.

Vedi anche samples(), attachment() e internalTextureFormat().

QOpenGLFramebufferObjectFormat::QOpenGLFramebufferObjectFormat(const QOpenGLFramebufferObjectFormat &other)

Crea una copia di other.

[noexcept] QOpenGLFramebufferObjectFormat::~QOpenGLFramebufferObjectFormat()

Distrugge l'QOpenGLFramebufferObjectFormat.

QOpenGLFramebufferObject::Attachment QOpenGLFramebufferObjectFormat::attachment() const

Restituisce la configurazione dei buffer di profondità e stencil associati a un oggetto framebuffer. Il valore predefinito è QOpenGLFramebufferObject::NoAttachment.

Vedi anche setAttachment().

GLenum QOpenGLFramebufferObjectFormat::internalTextureFormat() const

Restituisce il formato interno della texture di un oggetto framebuffer o del buffer di colore di un oggetto framebuffer multisample. Il valore predefinito è GL_RGBA8 sui sistemi OpenGL desktop e GL_RGBA sui sistemi OpenGL/ES.

Vedi anche setInternalTextureFormat().

bool QOpenGLFramebufferObjectFormat::mipmap() const

Restituisce true se il mipmapping è abilitato.

Vedi anche setMipmap().

int QOpenGLFramebufferObjectFormat::samples() const

Restituisce il numero di campioni per pixel se un oggetto framebuffer è un oggetto framebuffer multisample. In caso contrario, restituisce 0. Il valore predefinito è 0.

Vedi anche setSamples().

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

Imposta la configurazione degli allegati di un oggetto framebuffer su attachment.

Vedi anche attachment().

void QOpenGLFramebufferObjectFormat::setInternalTextureFormat(GLenum internalTextureFormat)

Imposta il formato interno della texture di un oggetto framebuffer o del buffer di colore di un oggetto framebuffer multisample su internalTextureFormat.

Vedi anche ` internalTextureFormat()` .

void QOpenGLFramebufferObjectFormat::setMipmap(bool enabled)

Abilita il mipmapping se la variabile ` enabled ` è impostata su `true`; in caso contrario, lo disabilita.

Il mipmapping è disabilitato per impostazione predefinita.

Se il mipmapping è abilitato, verrà allocata memoria aggiuntiva per i livelli di mipmap. I livelli di mipmap possono essere aggiornati associando la texture e chiamando glGenerateMipmap(). Il mipmapping non può essere abilitato per oggetti framebuffer multisampionati.

Vedi anche ` mipmap()` e ` QOpenGLFramebufferObject::texture()`.

void QOpenGLFramebufferObjectFormat::setSamples(int samples)

Imposta il numero di campioni per pixel per un oggetto framebuffer multisample su samples. Il numero predefinito di campioni, pari a 0, corrisponde a un normale oggetto framebuffer non multisample.

Se il numero desiderato di campioni per pixel non è supportato dall'hardware, verrà utilizzato il numero massimo di campioni per pixel. Si noti che gli oggetti framebuffer multisample non possono essere associati come texture. Inoltre, per creare un framebuffer con più di un campione per pixel è necessaria l'estensione GL_EXT_framebuffer_multisample.

Vedi anche samples().

void QOpenGLFramebufferObjectFormat::setTextureTarget(GLenum target)

Imposta come destinazione della texture associata a un oggetto framebuffer il valore target. Viene ignorato per gli oggetti framebuffer multisample.

Vedi anche ` textureTarget()` e ` samples()`.

GLenum QOpenGLFramebufferObjectFormat::textureTarget() const

Restituisce la destinazione della texture associata a un oggetto framebuffer. Viene ignorato per gli oggetti framebuffer multisample. Il valore predefinito è GL_TEXTURE_2D.

Vedi anche setTextureTarget() e samples().

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

Restituisce " false " se tutte le opzioni di questo formato di oggetto framebuffer corrispondono a " other"; in caso contrario, restituisce " true".

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

Assegna " other " a questo oggetto.

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

Restituisce " true " se tutte le opzioni di questo formato di oggetto framebuffer coincidono con quelle di " other"; in caso contrario, restituisce " false".

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.