Brenta Engine 1.2
Loading...
Searching...
No Matches
renderer.hpp
1// SPDX-License-Identifier: MIT
2// Author: Giovanni Santini
3// Mail: giovanni.santini@proton.me
4// Github: @San7o
5
6#include <brenta/model.hpp>
7#include <brenta/shader.hpp>
8#include <brenta/camera.hpp>
9#include <brenta/model.hpp>
10
11#include <glm/glm.hpp>
12
13#pragma once
14
15namespace brenta
16{
17
19{
20public:
21
22 class item;
23
24 renderer() = delete;
25 ~renderer() = delete;
26
27 static void begin_frame(const camera& cam);
28 static void submit(const renderer::item& it);
29 static void end_frame();
30
31private:
32
33 static glm::mat4 projection;
34 static glm::mat4 view;
35 static glm::vec3 cam_position;
36 static std::vector<item> render_queue;
37
38 static void flush();
39
40};
41
43{
44public:
45 const model* m;
46 const shader::name_t material;
47 glm::mat4 transform;
48
49 item() = default;
50 item(const model* m,
51 const shader::name_t material,
52 const glm::mat4 transform = glm::mat4(1.0))
53 : m(m), material(material), transform(transform) {}
54
55 renderer::item& translate(glm::vec3 translation);
56 renderer::item& rotate(glm::vec3 rotation);
57 renderer::item& scale(float scale);
58
59};
60
61} // namespace brenta
The Camera class.
Definition camera.hpp:81
Model class.
Definition model.hpp:29