blob: ca98e6fe6e8135b5302a4bd9c72147483b4bd358 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#ifndef CLIENT_RENDER_RENDER_HH_
#define CLIENT_RENDER_RENDER_HH_
#include <algorithm>
#include <array>
#include <chrono>
#include <cmath>
#include <fstream>
#include <iostream>
#include <optional>
#include <ranges>
#include <unordered_map>
#include <epoxy/gl.h> // this has to go before SDL2
#include <epoxy/glx.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_access.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <ft2build.h>
#include FT_FREETYPE_H
#include "client/render/camera.hh"
#include "client/render/program.hh"
#include "shared/shared.hh"
#include "shared/world.hh"
namespace client {
namespace render {
void init();
void quit() noexcept;
// Getters
int get_fps() noexcept;
SDL_Window* const& get_sdl_window() noexcept;
const glm::ivec2& get_window_size() noexcept;
// Update
void update_uniforms() noexcept;
void swap_window() noexcept;
// Render
void render_rectangle(const glm::vec2& pos, const glm::vec2& size,
const glm::vec4& colour) noexcept;
void render_text(const std::string_view text, const unsigned int size,
const bool is_centered, const bool is_vcentered,
const glm::vec4& colour, const glm::mat4& matrix) noexcept;
void render_cube_outline(const glm::vec3& pos,
const glm::vec4& colour) noexcept;
} // namespace render
} // namespace client
#endif
|