nngn
Loading...
Searching...
No Matches
rasterizer.cpp File Reference
#include "rasterizer.h"
#include "math/vec3.h"
#include "math/vec4.h"
#include "frame_buffer.h"
Include dependency graph for rasterizer.cpp:

Namespaces

namespace  anonymous_namespace{rasterizer.cpp}
 
namespace  nngn
 
namespace  nngn::term
 

Typedefs

using texel3 = Texture::texel3
 
using texel4 = Texture::texel4
 
using TerminalMode = nngn::Graphics::TerminalMode
 
using anonymous_namespace{rasterizer.cpp}::write_f = void(FrameBuffer::*)(std::size_t, std::size_t, texel4)
 

Functions

auto anonymous_namespace{rasterizer.cpp}::to_clip (mat4 proj, nngn::Vertex v0, nngn::Vertex v1, auto &&f)
 Transforms world-space vertices into clip space.
 
bool anonymous_namespace{rasterizer.cpp}::clip (vec3 bl, vec3 tr)
 Checks whether a sprite lies entirely outside of the clip volume.
 
std::size_t anonymous_namespace{rasterizer.cpp}::clamp_floor (float max, float v)
 Clamps value between 0 and max, rounds toward -infinity.
 
std::size_t anonymous_namespace{rasterizer.cpp}::clamp_ceil (float max, float v)
 Clamps value between 0 and max, rounds toward +infinity.
 
float anonymous_namespace{rasterizer.cpp}::uv_coord (float p0, std::size_t p, float p1, float t0, float t1)
 Calculates texture coordinates for a given position in a sprite.
 
vec2 anonymous_namespace{rasterizer.cpp}::to_screen (uvec2 size, vec3 v)
 Transforms clip-space vertices into screen space.
 
write_f anonymous_namespace{rasterizer.cpp}::write_fn_for_mode (nngn::Graphics::TerminalMode m)
 
void anonymous_namespace{rasterizer.cpp}::sprite (std::span< const nngn::Vertex > vbo, std::span< const u32 > ebo, mat4 proj, std::span< const Texture > textures, FrameBuffer *fb, TerminalMode mode, auto &&pos_f)
 

Typedef Documentation

◆ TerminalMode

◆ texel3

◆ texel4