22 Q_DECLARE_PRIVATE(QRhiWidget)
23 Q_PROPERTY(
int sampleCount READ sampleCount WRITE setSampleCount NOTIFY sampleCountChanged)
24 Q_PROPERTY(TextureFormat colorBufferFormat READ colorBufferFormat WRITE setColorBufferFormat NOTIFY colorBufferFormatChanged)
25 Q_PROPERTY(QSize fixedColorBufferSize READ fixedColorBufferSize WRITE setFixedColorBufferSize NOTIFY fixedColorBufferSizeChanged)
26 Q_PROPERTY(
bool mirrorVertically READ isMirrorVerticallyEnabled WRITE setMirrorVertically NOTIFY mirrorVerticallyChanged)
27 QDOC_PROPERTY(
bool autoRenderTarget READ isAutoRenderTargetEnabled WRITE setAutoRenderTarget)
30 explicit QRhiWidget(QWidget *parent =
nullptr, Qt::WindowFlags f = {});
31 ~QRhiWidget() override;
43 enum class TextureFormat {
54 bool isDebugLayerEnabled()
const;
55 void setDebugLayerEnabled(
bool enable);
57 int sampleCount()
const;
58 void setSampleCount(
int samples);
60 TextureFormat colorBufferFormat()
const;
61 void setColorBufferFormat(TextureFormat format);
63 QSize fixedColorBufferSize()
const;
64 void setFixedColorBufferSize(QSize pixelSize);
65 void setFixedColorBufferSize(
int w,
int h) { setFixedColorBufferSize(QSize(w, h)); }
67 bool isMirrorVerticallyEnabled()
const;
68 void setMirrorVertically(
bool enabled);
70 QImage grabFramebuffer()
const;
73 explicit QRhiWidget(QRhiWidgetPrivate &dd, QWidget *parent =
nullptr, Qt::WindowFlags f = {});
75 bool isAutoRenderTargetEnabled()
const;
76 void setAutoRenderTarget(
bool enabled);
78 virtual void initialize(QRhiCommandBuffer *cb);
79 virtual void render(QRhiCommandBuffer *cb);
80 virtual void releaseResources();
83 QRhiTexture *colorTexture()
const;
84 QRhiRenderBuffer *msaaColorBuffer()
const;
85 QRhiTexture *resolveTexture()
const;
86 QRhiRenderBuffer *depthStencilBuffer()
const;
87 QRhiRenderTarget *renderTarget()
const;
89 void resizeEvent(QResizeEvent *e) override;
90 void paintEvent(QPaintEvent *e) override;
91 bool event(QEvent *e) override;
94 void frameSubmitted();
96 void sampleCountChanged(
int samples);
97 void colorBufferFormatChanged(TextureFormat format);
98 void fixedColorBufferSizeChanged(
const QSize &pixelSize);
99 void mirrorVerticallyChanged(
bool enabled);