Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Laszlo Agocs
qtrhi
Commits
d5952b1f
Commit
d5952b1f
authored
Jan 06, 2019
by
Laszlo Agocs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix msaa option in triquadcube example
parent
0c9d9458
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
examples/rhi/shared/examplefw.h
examples/rhi/shared/examplefw.h
+7
-6
examples/rhi/triquadcube/triquadcube.cpp
examples/rhi/triquadcube/triquadcube.cpp
+4
-5
No files found.
examples/rhi/shared/examplefw.h
View file @
d5952b1f
...
...
@@ -119,7 +119,6 @@ QString graphicsApiName()
QRhi
::
Flags
rhiFlags
=
0
;
int
sampleCount
=
1
;
QRhiSwapChain
::
Flags
scFlags
=
0
;
void
(
*
preInitFunc
)()
=
nullptr
;
class
Window
:
public
QWindow
{
...
...
@@ -439,10 +438,17 @@ int main(int argc, char **argv)
qDebug
(
"Selected graphics API is %s"
,
qPrintable
(
graphicsApiName
()));
qDebug
(
"This is a multi-api example, use command line arguments to override:
\n
%s"
,
qPrintable
(
cmdLineParser
.
helpText
()));
#ifdef EXAMPLEFW_PREINIT
void
preInit
();
preInit
();
#endif
// OpenGL specifics.
QSurfaceFormat
fmt
;
fmt
.
setDepthBufferSize
(
24
);
fmt
.
setStencilBufferSize
(
8
);
if
(
sampleCount
>
1
)
fmt
.
setSamples
(
sampleCount
);
QSurfaceFormat
::
setDefaultFormat
(
fmt
);
// Vulkan setup.
...
...
@@ -468,11 +474,6 @@ int main(int argc, char **argv)
}
#endif
#ifdef EXAMPLEFW_PREINIT
void
preInit
();
preInit
();
#endif
// Create and show the window.
Window
w
;
#if QT_CONFIG(vulkan)
...
...
examples/rhi/triquadcube/triquadcube.cpp
View file @
d5952b1f
...
...
@@ -74,7 +74,6 @@ struct {
QuadRenderer
quadRenderer
;
TexturedCubeRenderer
cubeRenderer
;
TriangleOnCubeRenderer
liveTexCubeRenderer
;
int
sampleCount
=
1
;
bool
onScreenOnly
=
false
;
bool
triangleOnly
=
false
;
QSize
lastOutputSize
;
...
...
@@ -114,27 +113,27 @@ void Window::customInit()
#endif
d
.
triRenderer
.
setRhi
(
m_r
);
d
.
triRenderer
.
setSampleCount
(
d
.
sampleCount
);
d
.
triRenderer
.
setSampleCount
(
sampleCount
);
d
.
triRenderer
.
initResources
(
m_rp
);
if
(
!
d
.
triangleOnly
)
{
d
.
triRenderer
.
setTranslation
(
QVector3D
(
0
,
0.5
f
,
0
));
d
.
quadRenderer
.
setRhi
(
m_r
);
d
.
quadRenderer
.
setSampleCount
(
d
.
sampleCount
);
d
.
quadRenderer
.
setSampleCount
(
sampleCount
);
d
.
quadRenderer
.
setPipeline
(
d
.
triRenderer
.
pipeline
());
d
.
quadRenderer
.
initResources
(
m_rp
);
d
.
quadRenderer
.
setTranslation
(
QVector3D
(
1.5
f
,
-
0.5
f
,
0
));
d
.
cubeRenderer
.
setRhi
(
m_r
);
d
.
cubeRenderer
.
setSampleCount
(
d
.
sampleCount
);
d
.
cubeRenderer
.
setSampleCount
(
sampleCount
);
d
.
cubeRenderer
.
initResources
(
m_rp
);
d
.
cubeRenderer
.
setTranslation
(
QVector3D
(
0
,
-
0.5
f
,
0
));
}
if
(
!
d
.
onScreenOnly
)
{
d
.
liveTexCubeRenderer
.
setRhi
(
m_r
);
d
.
liveTexCubeRenderer
.
setSampleCount
(
d
.
sampleCount
);
d
.
liveTexCubeRenderer
.
setSampleCount
(
sampleCount
);
d
.
liveTexCubeRenderer
.
initResources
(
m_rp
);
d
.
liveTexCubeRenderer
.
setTranslation
(
QVector3D
(
-
2.0
f
,
0
,
0
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment