nngn
Loading...
Searching...
No Matches
rasterizer.h
Go to the documentation of this file.
1#ifndef NNGN_GRAPHICS_TERMINAL_RASTERIZER_H
2#define NNGN_GRAPHICS_TERMINAL_RASTERIZER_H
3
4#include "graphics/graphics.h"
5#include "math/mat4.h"
6#include "math/vec2.h"
7
8#include "texture.h"
9
10namespace nngn::term {
11
12class FrameBuffer;
13
16public:
18 explicit Rasterizer(Mode m) : mode{m} {}
20 mat4 proj(void) const { return this->m_proj; }
22 mat4 hud_proj(void) const { return this->m_hud_proj; }
24 void update_camera(
25 uvec2 term_size, uvec2 window_size,
26 mat4 proj, mat4 hud_proj, mat4 view);
28 void sprite(
29 std::span<const Vertex> vbo, std::span<const u32> ebo, mat4 proj,
30 std::span<const Texture> textures, FrameBuffer *fb) const;
32 void font(
33 std::span<const Vertex> vbo, std::span<const u32> ebo, mat4 proj,
34 std::span<const Texture> font, FrameBuffer *fb) const;
35private:
38};
39
40}
41
42#endif
Definition frame_buffer.h:12
Axis-aligned sprite rasterizer with texture sampling.
Definition rasterizer.h:15
mat4 proj(void) const
World projection matrix.
Definition rasterizer.h:20
mat4 m_proj
Definition rasterizer.h:36
mat4 hud_proj(void) const
UI projection matrix.
Definition rasterizer.h:22
mat4 m_hud_proj
Definition rasterizer.h:36
Rasterizer(Mode m)
Definition rasterizer.h:18
Mode mode
Definition rasterizer.h:37
void sprite(std::span< const Vertex > vbo, std::span< const u32 > ebo, mat4 proj, std::span< const Texture > textures, FrameBuffer *fb) const
Rasterizes a VBO/EBO pair containing textured quad.
Definition rasterizer.cpp:138
void update_camera(uvec2 term_size, uvec2 window_size, mat4 proj, mat4 hud_proj, mat4 view)
Updates internal camera matrices.
Definition rasterizer.cpp:122
Definition const.h:6
local font
Definition repl.lua:1
local m
Definition input.lua:28
TerminalMode
Definition graphics.h:163