Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit d9ef64a

Browse files
committed
Use constexpr verts and indices (just for demonstration)
1 parent a5b335b commit d9ef64a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/src/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ namespace
5050
const auto& renderDevice = engine.RenderDevice();
5151
if (!shader.Load(renderDevice.get_device(), vertexSpirV, fragmentSpirV)) { throw std::runtime_error{"Failed to load shaders"}; }
5252

53-
const auto vertices = std::array{
54-
tkge::graphics::Vertex{.position = {-0.5f, -0.5f}, .colour = kvf::red_v.to_linear()},
55-
tkge::graphics::Vertex{.position = {0.5f, -0.5f}, .colour = kvf::green_v.to_linear()},
56-
tkge::graphics::Vertex{.position = {0.5f, 0.5f}, .colour = kvf::blue_v.to_linear()},
57-
tkge::graphics::Vertex{.position = {-0.5f, 0.5f}, .colour = kvf::yellow_v.to_linear()},
53+
constexpr auto vertices = std::array{
54+
tkge::graphics::Vertex{.position = {-0.5f, -0.5f}, .colour = kvf::red_v.to_vec4()},
55+
tkge::graphics::Vertex{.position = {0.5f, -0.5f}, .colour = kvf::green_v.to_vec4()},
56+
tkge::graphics::Vertex{.position = {0.5f, 0.5f}, .colour = kvf::blue_v.to_vec4()},
57+
tkge::graphics::Vertex{.position = {-0.5f, 0.5f}, .colour = kvf::yellow_v.to_vec4()},
5858
};
5959

60-
const auto indices = std::array{
60+
constexpr auto indices = std::array{
6161
0u, 1u, 2u, 2u, 3u, 0u,
6262
};
6363

0 commit comments

Comments
 (0)