9
UMLClass
1143
909
333
63
2D Renderer
--
draw(vertices, indices, textureAtlasIndex)
draw(vertices, indices)
bg=BLUE
style=autoresize
UMLClass
855
1503
405
126
Rectangle
--
+ draw()
+ setters(val, updateStrategy=true)
+ getters(): const&
--
- vec2 size
- vec2 pos
- drawStrategy: unique_ptr<DrawStrategy<Rectangle> >
style=autoresize
bg=GRAY
group=group-7
UMLClass
288
1368
144
81
FontManager
--
- fonts[]: Font
- lib: FT_Library
style=autoresize
UMLClass
855
1710
369
126
Text
--
+ Text(string&, DrawStrategy&&)
+ draw()
+ setters(val, updateStrategy=true)
+ getters(): const&
--
- string text
- drawStrategy: unique_ptr<DrawStrategy<Text> >
style=autoresize
bg=GRAY
group=group-7
Relation
540
1575
333
162
lt=<-
10.0;10.0;350.0;160.0
UMLClass
1260
693
126
36
VulkanInstance
bg=BLUE
style=autoresize
Relation
1296
720
72
207
lt=<-
60.0;10.0;10.0;210.0
UMLClass
360
1539
189
63
Font
--
- face: FT_Face
- charInfos[]: CharInfo
style=autoresize
UMLClass
576
1377
180
99
TextDS
--
+ draw()
+ update(const Text&)
--
- buffer: VIBuffer
- Renderer2D& renderer
bg=BLUE
style=autoresize
UMLNote
0
630
369
162
/Target code/
using Drawable = std::variant<Text, Rectangle>
std::vector<Drawable> shapes;
shapes.emplace_back(Rectangle((5, 5), (42, 42),
TextDrawStrategy(renderer);
);
for (shape : shapes) {
shape.draw();
}
style=autoresize
bg=DARK_GRAY
UMLNote
855
1899
396
90
*Drawables have strategies*
+ very extendable
- complicated object creation
- possible lifetime issues with renderer references
- heavy use of virtual functions
style=autoresize
bg=RED
group=group-7
Relation
1251
963
63
180
lt=->
10.0;180.0;50.0;10.0
UMLClass
540
1206
225
99
RectangleColoredDS
--
+ draw()
+ update(const Rect&)
--
- buffer: VIBuffer
- const Renderer2D& renderer
bg=BLUE
style=autoresize
Relation
1251
1548
162
36
lt=<<<<-
or child class
10.0;20.0;160.0;20.0
Relation
738
1440
162
288
lt=<<<<<-
17.0;10.0;160.0;301.0
UMLClass
1422
1755
225
99
template=T: StrategyFor
PrintDrawStrategy
--
+ draw()
+ update(const T&)
--
- tAsString: string
style=autoresize
UMLClass
513
1098
252
81
RectangleTexturedVkDS
--
+ draw(): void
+ update(Rectangle&): void
- setTextureCoordinates(): void
style=autoresize
Relation
756
1269
81
27
lt=<<<<<-
10.0;10.0;70.0;10.0
UMLClass
117
1593
135
63
CharInfo
--
- topLeft: vec2
- botRight: vec2
style=autoresize
UMLClass
1395
1530
243
81
template=T: StrategyFor
/DrawStrategy/
--
+ draw() = 0
+ update(const T&) = 0
style=autoresize
Relation
1494
1602
27
180
lt=<<-
10.0;10.0;10.0;180.0
UMLClass
1053
1125
396
243
VulkanDS
--
# vertices: Vertex2D[]
# indices: uint32_t[]
# vertexBufferInfo: BufferInfo
# indexBufferInfo: BufferInfo
# renderer: Renderer2D&
# bufferManager: BufferManager<Vertex2D, uint32_t>&
--
+ getVertices(): Vertex2D[]
+ getIndices(): uint32_t[]
+ getVertexBufferInfo(): BufferInfo&
+ getIndexBufferInfo(): BufferInfo&
+ setIndexOffset(uint32_t): void
+ normalizeVertices(float, float): void
+ buffersInitalized(): bool
# updateBufferInfos(): void
style=autoresize
UMLClass
1737
369
216
99
MemoryInfo
--
+ memory: vk::DeviceMemory
+ offset: vk::DeviceSize
+ memoryTypeIndex: uint32_t
style=autoresize
group=group-1
bg=GREEN
UMLClass
1737
504
621
90
VulkanAllocator
--
- memory: DeviceMemory[]
--
+ allocate(vk::MemoryAllocateInfo&, vk::MemoryRequirements2&, MemoryInfo&): void
+ free(MemoryInfo&): void
style=autoresize
group=group-1
bg=GREEN
UMLClass
2043
297
306
126
DeviceMemory
--
+ DeviceMemory:
+ DeviceMemory(vk::DeviceSize):
+ size: vk::DeviceSize
+ memory: vk::DeviceMemory
+ dynBlockAllocator: DynBlockAllocator
style=autoresize
group=group-1
bg=GREEN
Relation
2169
414
108
108
lt=-
m1=*
m2=1
< allocates
group=group-1
bg=GREEN
10.0;10.0;10.0;100.0
Relation
1944
387
126
45
lt=-[dBA]
m1=1..n
m2=1
manages
group=group-1
bg=GREEN
10.0;20.0;110.0;20.0
Relation
1377
567
378
162
lt=<<<<<-
10.0;160.0;400.0;10.0
Relation
1773
585
27
315
lt=<-
10.0;10.0;10.0;330.0
UMLClass
621
1692
90
180
b
group=group-5
UMLClass
351
1692
90
180
a
group=group-5
Relation
432
1701
207
36
lt=<<-
b inherits from a
group=group-5
10.0;20.0;210.0;20.0
Relation
432
1737
207
36
lt=<-
b is associated with a
group=group-5
10.0;20.0;210.0;20.0
Relation
432
1773
207
36
lt=<.
b depends on a
group=group-5
10.0;20.0;210.0;20.0
Relation
432
1845
207
54
lt=<<<<<-
composition
a creates b
and b needs a
group=group-5
10.0;20.0;210.0;20.0
Relation
432
1800
207
54
lt=<<<<-
aggregation
a creates b
b can live without a
group=group-5
10.0;20.0;210.0;20.0
Relation
1440
981
333
198
lt=<-
m1=1
m2=1
gets buffer from
350.0;10.0;10.0;200.0
UMLClass
720
900
306
126
VulkanTexturedDS
--
# texture: Texture
# textureAtlasIndex: TextureAtlasIndex
# textureManager: TextureManager&
--
+ getTexture(): Texture&
+ getTexureAtlasIndex(): uint32_t
style=autoresize
UMLClass
486
360
630
216
TextureManager
--
- atlases: TextureAtlas[]
- textures: unordered_string_map<Texture>
- textureInfos: TextureInfo[]
--
+ getTexture(std::string&): Texture
+ setTexCoords(Texture&, glm::vec2&): void
+ getDescriptorSet: vk::DescriptorSet&
+ getDescriptorSetLayout: vk::DescriptorSetLayout&
+ getTextureAtlas(Texture&): TextureAtlas&
+ getTextureAtlasIndex(Texture&): TextureAtlasIndex
+ getAtlasCount: uint32_t
+ addAtlas(uint16_t, uint16_t, uint16_t, uint16_t, vk::Format): TextureAtlasIndex
- loadTextureFromFile(std::string&): Texture
style=autoresize
group=group-4
bg=YELLOW
UMLClass
594
54
522
234
TextureAtlas
--
- imageFormat: vk::Format
- textureImage: vk::Image
- textureImageMemory: MemoryInfo
- textureImageView: vk::ImageView
- textureSampler: vk::Sampler
- freeAreas: TextureImageAreas[]
- slotWidth: uint16_t
- slotHeight: uint16_t
- slotCountX: uint16_t
- slotCountY: uint16_t
--
+ addTexture(uint8_t*, uint16_t, uint16_t, uint8_t): { vec2, vec2 }
+ getTextureImageView(): vk::ImageView&
+ getTextureSampler(): vk::Sampler&
style=autoresize
group=group-4
bg=YELLOW
UMLClass
702
648
252
108
TextureInfo
--
+ atlas: TextureAtlasIndex
+ texCoordTopLeft: glm::vec2
+ texCoordBottomRight: glm::vec2
style=autoresize
group=group-4
bg=YELLOW
UMLPackage
1728
270
648
342
vulkan memory allocation
layer=-1
group=group-1
bg=GREEN
UMLPackage
468
0
666
774
vulkan textures
group=group-4
bg=YELLOW
Relation
900
279
36
99
lt=<<<<-
m1=1
m2=*
group=group-4
bg=YELLOW
10.0;90.0;10.0;10.0
Relation
1107
531
225
180
lt=<-
230.0;180.0;10.0;10.0
Relation
1107
243
243
468
lt=<-
250.0;500.0;10.0;10.0
Relation
729
567
81
99
lt=-
m1=1..n
m2=1
manages
group=group-4
bg=YELLOW
10.0;90.0;10.0;10.0
Relation
1107
198
639
216
lt=<-
690.0;220.0;10.0;10.0
Relation
1899
810
90
90
lt=<-
m1=*
m2=1
< manages
bg=ORANGE
group=group-3
10.0;10.0;10.0;80.0
UMLClass
1755
873
729
144
template=VertexT: VertexType, IndexT: SupportedIndexType
BufferManager
--
- vertexBuffers: Buffer[]
- indexBuffers: Buffer[]
--
+ getVertexBuffer(BufferInfo&): vk::Buffer
+ getIndexBuffer(BufferInfo&): vk::Buffer
+ addVertices(VertexRange&, IndexRange&): { BufferInfo : BufferInfo }
+ removeVertices(BufferInfo&, BufferInfo&): void
style=autoresize
bg=ORANGE
group=group-3
UMLClass
1800
711
243
108
Buffer
--
+ buffer: vk::Buffer
+ bufferMemory: MemoryInfo
+ bufferSize: vk::DeviceSize
+ allocator: DynBlockAllocator
style=autoresize
bg=ORANGE
group=group-3
UMLClass
2115
711
153
99
BufferInfo
--
+ index: uint32_t
+ offset: uint32_t
+ count: uint32_t
style=autoresize
bg=ORANGE
group=group-3
Relation
2106
792
36
108
lt=<<<<-
m1=1
m2=*
bg=ORANGE
group=group-3
10.0;100.0;10.0;10.0
Relation
2034
738
99
36
lt=<-
m1=1
m2=1
bg=ORANGE
group=group-3
10.0;10.0;90.0;10.0
UMLPackage
1737
675
756
351
vulkan vertex & index buffer management
bg=ORANGE
group=group-3
Relation
612
567
225
351
lt=<-
10.0;10.0;230.0;370.0
Relation
756
1125
315
117
lt=<<-
330.0;110.0;10.0;10.0
Relation
711
981
72
171
lt=<<-
10.0;10.0;60.0;170.0
Relation
1098
1359
369
198
lt=<<-
390.0;200.0;10.0;10.0
Relation
756
1152
81
27
lt=<<<<<-
10.0;10.0;70.0;10.0
Relation
756
1224
315
117
lt=<<-
330.0;110.0;10.0;10.0
Relation
810
1152
27
144
lt=-
10.0;140.0;10.0;10.0
Relation
810
1269
81
252
lt=-
10.0;10.0;70.0;260.0
Relation
1215
1593
216
207
lt=<<<<-
or child class
10.0;210.0;200.0;10.0
Relation
747
1350
324
90
lt=<<-
340.0;10.0;10.0;80.0
Relation
747
1017
180
423
lt=<<-
180.0;10.0;10.0;450.0
Relation
414
1440
27
117
lt=<<<<<-
10.0;10.0;10.0;110.0
UMLPackage
810
1467
513
540
Drawables
bg=GRAY
group=group-7