Represents an onscreen (swapchain) or offscreen (texture) render target. More...
| Header: | #include <rhi/qrhi.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui)target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate) |
| qmake: | QT += gui-private |
| Since: | Qt 6.6 |
| Inherits: | QRhiResource |
| Inherited By: |
| virtual float | devicePixelRatio() const = 0 |
| virtual QSize | pixelSize() const = 0 |
| QRhiRenderPassDescriptor * | renderPassDescriptor() const |
| virtual int | sampleCount() const = 0 |
| void | setRenderPassDescriptor(QRhiRenderPassDescriptor *desc) |
Applications do not create an instance of this class directly. Rather, it is the subclass QRhiTextureRenderTarget that is instantiable by clients of the API via newTextureRenderTarget(). The other subclass is QRhiSwapChainRenderTarget, which is the type QRhiSwapChain returns when calling currentFrameRenderTarget().
Note: This is a RHI API with limited compatibility guarantees, see QRhi for details.
See also QRhiSwapChainRenderTarget and QRhiTextureRenderTarget.
[pure virtual] float QRhiRenderTarget::devicePixelRatio() constReturns the device pixel ratio. For QRhiTextureRenderTarget this is always 1. For targets retrieved from a QRhiSwapChain the value reflects the device pixel ratio of the targeted QWindow.
[pure virtual] QSize QRhiRenderTarget::pixelSize()
constReturns the size in pixels.
Valid only after create() has been called successfully. Until then the result is a default-constructed QSize.
With QRhiTextureRenderTarget the returned size is the size of the associated attachments at the time of create(), in practice the size of the first color attachment, or the depth/stencil buffer if there are no color attachments. If the associated textures or renderbuffers are resized and rebuilt afterwards, then pixelSize() performs an implicit call to create() in order to rebuild the underlying data structures. This implicit check is similar to what QRhiCommandBuffer::beginPass() does, and ensures that the returned size is always up-to-date.
Returns the associated QRhiRenderPassDescriptor.
See also setRenderPassDescriptor().
[pure virtual] int QRhiRenderTarget::sampleCount() constReturns the sample count or 1 if multisample antialiasing is not relevant for this render target.
Sets the QRhiRenderPassDescriptor desc for use with this render target.
See also renderPassDescriptor().
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: