This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 3
3
#include < Tkge/Graphics/Drawable.hpp>
4
4
#include < Tkge/Graphics/Shader.hpp>
5
5
#include < klib/assert.hpp>
6
+ #include < kvf/color_bitmap.hpp>
6
7
#include < kvf/time.hpp>
7
8
#include < cmath>
8
9
#include < exception>
@@ -56,7 +57,16 @@ namespace
56
57
auto quad = Tkge::Graphics::Quad{};
57
58
quad.Create (glm::vec2{400 .0f });
58
59
quad.transform .position .x = -250 .0f ;
59
- quad.tint = kvf::magenta_v;
60
+
61
+ auto colourBitmap = kvf::ColorBitmap{glm::ivec2{2 , 2 }};
62
+ colourBitmap[0 , 0 ] = kvf::red_v;
63
+ colourBitmap[0 , 1 ] = kvf::green_v;
64
+ colourBitmap[1 , 0 ] = kvf::blue_v;
65
+ colourBitmap[1 , 1 ] = kvf::magenta_v;
66
+ auto texture = Tkge::Graphics::Texture{&engine.RenderDevice ()};
67
+ texture.Create (colourBitmap.bitmap ());
68
+ texture.sampler .filter = vk::Filter::eNearest;
69
+ quad.texture = &texture;
60
70
61
71
auto instancedQuad = Tkge::Graphics::InstancedQuad{};
62
72
instancedQuad.Create (glm::vec2{150 .0f });
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ namespace Tkge
25
25
explicit Engine (const WindowSurface& surface = {}, vk::SampleCountFlagBits aa = AntiAliasing);
26
26
27
27
[[nodiscard]] const kvf::RenderDevice& RenderDevice () const { return _renderDevice; }
28
+ [[nodiscard]] kvf::RenderDevice& RenderDevice () { return _renderDevice; }
28
29
29
30
[[nodiscard]] glm::ivec2 FramebufferSize () const ;
30
31
[[nodiscard]] auto FramebufferFormat () const -> vk::Format { return _renderPass.get_color_format (); }
You can’t perform that action at this time.
0 commit comments