QOpenGLFramebufferObjectFormat#

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

Synopsis#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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.

class PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat#

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat(other)

Parameters:

otherPySide6.QtOpenGL.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.

Constructs a copy of other.

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.attachment()#
Return type:

Attachment

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

See also

setAttachment()

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.internalTextureFormat()#
Return type:

int

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.

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.mipmap()#
Return type:

bool

Returns true if mipmapping is enabled.

See also

setMipmap()

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.__ne__(other)#
Parameters:

otherPySide6.QtOpenGL.QOpenGLFramebufferObjectFormat

Return type:

bool

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

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.__eq__(other)#
Parameters:

otherPySide6.QtOpenGL.QOpenGLFramebufferObjectFormat

Return type:

bool

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

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.samples()#
Return type:

int

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()

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.setAttachment(attachment)#
Parameters:

attachmentAttachment

Sets the attachment configuration of a framebuffer object to attachment.

See also

attachment()

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.setInternalTextureFormat(internalTextureFormat)#
Parameters:

internalTextureFormat – int

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

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.setMipmap(enabled)#
Parameters:

enabled – bool

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() texture()

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.setSamples(samples)#
Parameters:

samples – int

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()

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.setTextureTarget(target)#
Parameters:

target – int

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

PySide6.QtOpenGL.QOpenGLFramebufferObjectFormat.textureTarget()#
Return type:

int

Returns the texture target of the texture attached to a framebuffer object. Ignored for multisample framebuffer objects. The default is GL_TEXTURE_2D.