|
1 | 1 | #include <imgui.h>
|
| 2 | +#include <Tkge/Engine.hpp> |
| 3 | +#include <Tkge/Graphics/Shader.hpp> |
2 | 4 | #include <klib/assert.hpp>
|
3 |
| -#include <tkge/engine.hpp> |
4 | 5 | #include <exception>
|
5 | 6 | #include <print>
|
6 | 7 |
|
7 |
| -// temporary, until we have shader assets. |
8 |
| -#include <tkge/graphics/shader.hpp> |
| 8 | +// temporary, until we have shader Assets. |
9 | 9 | #include <filesystem>
|
10 | 10 | #include <fstream>
|
11 | 11 | #include <vector>
|
@@ -41,27 +41,27 @@ namespace
|
41 | 41 |
|
42 | 42 | void Run(const fs::path& assets_path)
|
43 | 43 | {
|
44 |
| - static constexpr tkge::WindowSurface surface{.size = {1280, 720}}; |
45 |
| - tkge::Engine engine{surface}; |
| 44 | + static constexpr Tkge::WindowSurface surface{.size = {1280, 720}}; |
| 45 | + Tkge::Engine engine{surface}; |
46 | 46 |
|
47 |
| - auto shader = tkge::graphics::Shader{}; |
48 |
| - const auto vertexSpirV = LoadSpirV((assets_path / "shaders/default.vert").string().c_str()); |
49 |
| - const auto fragmentSpirV = LoadSpirV((assets_path / "shaders/default.frag").string().c_str()); |
| 47 | + auto shader = Tkge::Graphics::Shader{}; |
| 48 | + const auto vertexSpirV = LoadSpirV((assets_path / "Shaders/Default.vert").string().c_str()); |
| 49 | + const auto fragmentSpirV = LoadSpirV((assets_path / "Shaders/Default.frag").string().c_str()); |
50 | 50 | const auto& renderDevice = engine.RenderDevice();
|
51 | 51 | if (!shader.Load(renderDevice.get_device(), vertexSpirV, fragmentSpirV)) { throw std::runtime_error{"Failed to load shaders"}; }
|
52 | 52 |
|
53 | 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()}, |
| 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()}, |
58 | 58 | };
|
59 | 59 |
|
60 | 60 | constexpr auto indices = std::array{
|
61 | 61 | 0u, 1u, 2u, 2u, 3u, 0u,
|
62 | 62 | };
|
63 | 63 |
|
64 |
| - const auto primitive = tkge::graphics::Primitive{ |
| 64 | + const auto primitive = Tkge::Graphics::Primitive{ |
65 | 65 | .vertices = vertices,
|
66 | 66 | .indices = indices,
|
67 | 67 | };
|
@@ -100,7 +100,7 @@ int main([[maybe_unused]] int argc, char** argv)
|
100 | 100 | try
|
101 | 101 | {
|
102 | 102 | KLIB_ASSERT(argc > 0);
|
103 |
| - const auto assets_path = Upfind(*argv, "assets"); |
| 103 | + const auto assets_path = Upfind(*argv, "Assets"); |
104 | 104 | Run(assets_path);
|
105 | 105 | }
|
106 | 106 | catch (const std::exception& e)
|
|
0 commit comments