Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
f8ab4fd3
Verified
Commit
f8ab4fd3
authored
2 years ago
by
Tobias Frisch
Browse files
Options
Downloads
Patches
Plain Diff
Reducing the code of the first_triangle example further
Signed-off-by:
Tobias Frisch
<
tfrisch@uni-koblenz.de
>
parent
baaf451d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/first_triangle/src/main.cpp
+1
-8
1 addition, 8 deletions
projects/first_triangle/src/main.cpp
with
1 addition
and
8 deletions
projects/first_triangle/src/main.cpp
+
1
−
8
View file @
f8ab4fd3
...
@@ -15,18 +15,12 @@ int main(int argc, const char** argv) {
...
@@ -15,18 +15,12 @@ int main(int argc, const char** argv) {
vkcv
::
Core
core
=
vkcv
::
Core
::
create
(
vkcv
::
Core
core
=
vkcv
::
Core
::
create
(
applicationName
,
applicationName
,
VK_MAKE_VERSION
(
0
,
0
,
1
),
VK_MAKE_VERSION
(
0
,
0
,
1
),
{
vk
::
QueueFlagBits
::
e
Transfer
,
vk
::
QueueFlagBits
::
eGraphics
,
vk
::
QueueFlagBits
::
eCompute
},
{
vk
::
QueueFlagBits
::
e
Graphics
},
{
VK_KHR_SWAPCHAIN_EXTENSION_NAME
}
{
VK_KHR_SWAPCHAIN_EXTENSION_NAME
}
);
);
vkcv
::
WindowHandle
windowHandle
=
core
.
createWindow
(
applicationName
,
windowWidth
,
windowHeight
,
true
);
vkcv
::
WindowHandle
windowHandle
=
core
.
createWindow
(
applicationName
,
windowWidth
,
windowHeight
,
true
);
vkcv
::
Window
&
window
=
core
.
getWindow
(
windowHandle
);
vkcv
::
Window
&
window
=
core
.
getWindow
(
windowHandle
);
auto
triangleIndexBuffer
=
vkcv
::
buffer
<
uint16_t
>
(
core
,
vkcv
::
BufferType
::
INDEX
,
3
);
uint16_t
indices
[
3
]
=
{
0
,
1
,
2
};
triangleIndexBuffer
.
fill
(
&
indices
[
0
],
sizeof
(
indices
));
core
.
setDebugLabel
(
triangleIndexBuffer
.
getHandle
(),
"Triangle Index Buffer"
);
vkcv
::
PassHandle
trianglePass
=
vkcv
::
passSwapchain
(
vkcv
::
PassHandle
trianglePass
=
vkcv
::
passSwapchain
(
core
,
core
,
...
@@ -66,7 +60,6 @@ int main(int argc, const char** argv) {
...
@@ -66,7 +60,6 @@ int main(int argc, const char** argv) {
core
.
setDebugLabel
(
trianglePipeline
,
"Triangle Pipeline"
);
core
.
setDebugLabel
(
trianglePipeline
,
"Triangle Pipeline"
);
vkcv
::
VertexData
vertexData
;
vkcv
::
VertexData
vertexData
;
vertexData
.
setIndexBuffer
(
triangleIndexBuffer
.
getHandle
());
vertexData
.
setCount
(
3
);
vertexData
.
setCount
(
3
);
vkcv
::
InstanceDrawcall
drawcall
(
vertexData
);
vkcv
::
InstanceDrawcall
drawcall
(
vertexData
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment