QRhiRenderTarget Class
Rappresenta un target di rendering su schermo (swapchain) o fuori schermo (texture). Per saperne di più...
| Intestazione: | #include <rhi/qrhi.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS GuiPrivate) target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate) |
| qmake: | QT += gui-private |
| A partire da: | Qt 6.6 |
| Eredita da: | QRhiResource |
| Ereditato da: |
Funzioni pubbliche
| virtual float | devicePixelRatio() const = 0 |
| virtual QSize | pixelSize() const = 0 |
| QRhiRenderPassDescriptor * | renderPassDescriptor() const |
| virtual int | sampleCount() const = 0 |
| void | setRenderPassDescriptor(QRhiRenderPassDescriptor *desc) |
Descrizione dettagliata
Le applicazioni non creano direttamente un'istanza di questa classe. È invece la sottoclasse QRhiTextureRenderTarget ad essere istanziabile dai client dell'API tramite newTextureRenderTarget(). L'altra sottoclasse è QRhiSwapChainRenderTarget, che è il tipo restituito da QRhiSwapChain quando si chiama currentFrameRenderTarget().
Nota: si tratta di un'API RHI con garanzie di compatibilità limitate; per ulteriori dettagli, consultare QRhi.
Vedi anche QRhiSwapChainRenderTarget e QRhiTextureRenderTarget.
Documentazione sulle funzioni membro
[pure virtual] float QRhiRenderTarget::devicePixelRatio() const
Restituisce il rapporto pixel del dispositivo. Per QRhiTextureRenderTarget questo valore è sempre 1. Per i target recuperati da un QRhiSwapChain, il valore riflette l'device pixel ratio del sito QWindow a cui si fa riferimento.
[pure virtual] QSize QRhiRenderTarget::pixelSize() const
Restituisce la dimensione in pixel.
Valido solo dopo che create() è stato chiamato con successo. Fino a quel momento il risultato è un oggetto QSize costruito con i valori predefiniti.
Con ` QRhiTextureRenderTarget `, la dimensione restituita è quella degli allegati associati al momento della chiamata a `create()`; in pratica, è la dimensione del primo allegato di colore oppure quella del buffer di profondità/stencil se non sono presenti allegati di colore. Se le texture o i buffer di rendering associati vengono successivamente ridimensionati e ricostruiti, pixelSize() esegue una chiamata implicita a create() per ricostruire le strutture dati sottostanti. Questo controllo implicito è simile a quanto fa QRhiCommandBuffer::beginPass() e garantisce che la dimensione restituita sia sempre aggiornata.
QRhiRenderPassDescriptor *QRhiRenderTarget::renderPassDescriptor() const
Restituisce l'QRhiRenderPassDescriptor associato.
Vedi anche setRenderPassDescriptor().
[pure virtual] int QRhiRenderTarget::sampleCount() const
Restituisce il numero di campioni oppure 1 se l'antialiasing multisample non è rilevante per questo render target.
void QRhiRenderTarget::setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Imposta l’ QRhiRenderPassDescriptor desc per l’utilizzo con questo render target.
Vedi anche renderPassDescriptor().
© 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.