summaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-26 14:43:55 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-11-26 21:39:34 +0000
commit58b3c7b0d5177e54a4dbb8f4cdbe2fc49804899e (patch)
tree206804a45ffe1f40120c8264223eb0785e2c32e1 /examples/quick
parentf9af3434498b65ecb89bf7054c71773d066fef0b (diff)
Fix building the d3d11underqml example with MinGW
Fix format mismatch qtdeclarative/examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp:369:16: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'HRESULT' {aka 'long int'} [-Werror=format=] qFatal("Failed to create buffer: 0x%x", hr); by casting to uint (as is done in an existing qWarning()). Change-Id: I9bed3066936af8a1831b695a76d40989a834fde9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 203acb1955c889b51b760c3f1410558b524c53d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp b/examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp
index 5737e419b0..9acfbfff23 100644
--- a/examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp
+++ b/examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp
@@ -245,7 +245,7 @@ void SquircleRenderer::mainPassRecordingStart()
memcpy(mp.pData, &t, 4);
m_context->Unmap(m_cbuf, 0);
} else {
- qFatal("Failed to map constant buffer: 0x%x", hr);
+ qFatal("Failed to map constant buffer: 0x%x", uint(hr));
}
D3D11_VIEWPORT v;
@@ -353,11 +353,11 @@ void SquircleRenderer::init()
HRESULT hr = m_device->CreateVertexShader(vs.constData(), vs.size(), nullptr, &m_vs);
if (FAILED(hr))
- qFatal("Failed to create vertex shader: 0x%x", hr);
+ qFatal("Failed to create vertex shader: 0x%x", uint(hr));
hr = m_device->CreatePixelShader(fs.constData(), fs.size(), nullptr, &m_ps);
if (FAILED(hr))
- qFatal("Failed to create pixel shader: 0x%x", hr);
+ qFatal("Failed to create pixel shader: 0x%x", uint(hr));
D3D11_BUFFER_DESC bufDesc;
memset(&bufDesc, 0, sizeof(bufDesc));
@@ -366,7 +366,7 @@ void SquircleRenderer::init()
bufDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
hr = m_device->CreateBuffer(&bufDesc, nullptr, &m_vbuf);
if (FAILED(hr))
- qFatal("Failed to create buffer: 0x%x", hr);
+ qFatal("Failed to create buffer: 0x%x", uint(hr));
m_context->UpdateSubresource(m_vbuf, 0, nullptr, vertices, 0, 0);
@@ -376,7 +376,7 @@ void SquircleRenderer::init()
bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
hr = m_device->CreateBuffer(&bufDesc, nullptr, &m_cbuf);
if (FAILED(hr))
- qFatal("Failed to create buffer: 0x%x", hr);
+ qFatal("Failed to create buffer: 0x%x", uint(hr));
D3D11_INPUT_ELEMENT_DESC inputDesc;
memset(&inputDesc, 0, sizeof(inputDesc));
@@ -389,7 +389,7 @@ void SquircleRenderer::init()
inputDesc.InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
hr = m_device->CreateInputLayout(&inputDesc, 1, vs.constData(), vs.size(), &m_inputLayout);
if (FAILED(hr))
- qFatal("Failed to create input layout: 0x%x", hr);
+ qFatal("Failed to create input layout: 0x%x", uint(hr));
D3D11_RASTERIZER_DESC rastDesc;
memset(&rastDesc, 0, sizeof(rastDesc));
@@ -397,13 +397,13 @@ void SquircleRenderer::init()
rastDesc.CullMode = D3D11_CULL_NONE;
hr = m_device->CreateRasterizerState(&rastDesc, &m_rastState);
if (FAILED(hr))
- qFatal("Failed to create rasterizer state: 0x%x", hr);
+ qFatal("Failed to create rasterizer state: 0x%x", uint(hr));
D3D11_DEPTH_STENCIL_DESC dsDesc;
memset(&dsDesc, 0, sizeof(dsDesc));
hr = m_device->CreateDepthStencilState(&dsDesc, &m_dsState);
if (FAILED(hr))
- qFatal("Failed to create depth/stencil state: 0x%x", hr);
+ qFatal("Failed to create depth/stencil state: 0x%x", uint(hr));
D3D11_BLEND_DESC blendDesc;
memset(&blendDesc, 0, sizeof(blendDesc));
@@ -421,7 +421,7 @@ void SquircleRenderer::init()
blendDesc.RenderTarget[0] = blend;
hr = m_device->CreateBlendState(&blendDesc, &m_blendState);
if (FAILED(hr))
- qFatal("Failed to create blend state: 0x%x", hr);
+ qFatal("Failed to create blend state: 0x%x", uint(hr));
}
#include "d3d11squircle.moc"