Chrysalis - Renderer Test Coverage


renderer/
File: renderer/include/BaseRenderer.h
Date: 2026-08-27 18:35:31
Lines:
0/30
0.0%
Functions:
0/20
0.0%
Branches:
0/32
0.0%
Decisions:
0/8
0.0%
Calls:
0/158
0.0%

Line Branch Decision Call Exec Source
1 #ifndef CHRYSALIS_BASERENDERER_H
2 #define CHRYSALIS_BASERENDERER_H
3
4 #include <glad/gl.h>
5
6 #include "BaseRendererData.h"
7
8 namespace Chrysalis {
9 template<typename D>
10 requires requires {
11 []<typename V>(BaseRendererData<V>*) -> auto {}(static_cast<D*>(nullptr));
12 }
13 class BaseRenderer {
14 using V = decltype([]<typename V>(BaseRendererData<V>*) -> V {}(static_cast<D*>(nullptr)));
15 protected:
16
0/15
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ Call 9 not invoked.
✗ Call 10 not invoked.
✗ Call 11 not invoked.
✗ Call 12 not invoked.
✗ Call 13 not invoked.
✗ Call 14 not invoked.
✗ explicit BaseRenderer(D* data): data_(data) {}
17 ✗ virtual ~BaseRenderer() {
18
0/10
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ Call 9 not invoked.
✗ Call 10 not invoked.
✗ Call 11 not invoked.
✗ delete data_;
19
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/7
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ if (vbo_ != 0) glDeleteBuffers(1, &vbo_);
20
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/7
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ if (vao_ != 0) glDeleteVertexArrays(1, &vao_);
21
0/3
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ }
22
23 public:
24 ✗ void upload() {
25
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/9
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ if (!data_->shouldUpload()) return;
26
0/5
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ glBindVertexArray(vao_);
27
0/5
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ glBindBuffer(GL_ARRAY_BUFFER, vbo_);
28
0/47
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ Call 9 not invoked.
✗ Call 10 not invoked.
✗ Call 11 not invoked.
✗ Call 12 not invoked.
✗ Call 13 not invoked.
✗ Call 14 not invoked.
✗ Call 15 not invoked.
✗ Call 16 not invoked.
✗ Call 19 not invoked.
✗ Call 20 not invoked.
✗ Call 21 not invoked.
✗ Call 22 not invoked.
✗ Call 23 not invoked.
✗ Call 24 not invoked.
✗ Call 25 not invoked.
✗ Call 26 not invoked.
✗ Call 27 not invoked.
✗ Call 28 not invoked.
✗ Call 29 not invoked.
✗ Call 30 not invoked.
✗ Call 31 not invoked.
✗ Call 32 not invoked.
✗ Call 33 not invoked.
✗ Call 34 not invoked.
✗ Call 35 not invoked.
✗ Call 36 not invoked.
✗ Call 37 not invoked.
✗ Call 38 not invoked.
✗ Call 39 not invoked.
✗ Call 40 not invoked.
✗ Call 41 not invoked.
✗ Call 42 not invoked.
✗ Call 43 not invoked.
✗ Call 46 not invoked.
✗ Call 49 not invoked.
✗ Call 50 not invoked.
✗ Call 51 not invoked.
✗ Call 52 not invoked.
✗ glBufferData(GL_ARRAY_BUFFER, data_->size() * sizeof(V), data_->vbo().data(), GL_DYNAMIC_DRAW);
29
0/1
✗ Call 0 not invoked.
✗ glBindBuffer(GL_ARRAY_BUFFER, 0);
30
0/1
✗ Call 0 not invoked.
✗ glBindVertexArray(0);
31 }
32
33 ✗ virtual void initialize() {
34
0/3
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ glGenVertexArrays(1, &vao_);
35
0/5
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ glBindVertexArray(vao_);
36
37
0/3
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ glGenBuffers(1, &vbo_);
38
0/5
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ glBindBuffer(GL_ARRAY_BUFFER, vbo_);
39
40
0/2
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ const auto layout = V::layout();
41
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/1
✗ Call 0 not invoked.
✗ for (GLuint i = 0; i < layout.size(); i++) {
42
0/6
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ const auto& [count, offset] = layout[i];
43
0/1
✗ Call 0 not invoked.
✗ glEnableVertexAttribArray(i);
44
0/3
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ glVertexAttribPointer(i, count, GL_FLOAT, GL_FALSE, sizeof(V), offset);
45 }
46
47
0/4
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ upload();
48
0/2
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ }
49
50 ✗ void render() {
51
0/5
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ glBindVertexArray(vao_);
52
0/7
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ draw();
53
0/1
✗ Call 0 not invoked.
✗ glBindVertexArray(0);
54 ✗ }
55
56 virtual void draw() = 0;
57 protected:
58 /// @uml{composition}
59 D* data_;
60 private:
61 GLuint vbo_ = 0;
62 GLuint vao_ = 0;
63 };
64 }
65
66 #endif //CHRYSALIS_BASERENDERER_H
67