group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
SdfAtlas.cpp File Reference

SDF glyph atlas baking and GPU upload implementation. More...

#include "SdfAtlas.hpp"
#include <SDL3/SDL.h>
#include <cstring>
#include <glm/glm.hpp>
#include <stb_truetype.h>
#include <vector>
Include dependency graph for SdfAtlas.cpp:

Classes

struct  Shelf
 Single shelf row used by the shelf-packing algorithm. More...

Macros

#define STB_TRUETYPE_IMPLEMENTATION

Functions

static bool packRect (std::vector< Shelf > &shelves, int atlasW, int atlasH, int w, int h, int &outX, int &outY)
 Try to pack a rectangle into the atlas using shelf-packing.

Detailed Description

SDF glyph atlas baking and GPU upload implementation.

Macro Definition Documentation

◆ STB_TRUETYPE_IMPLEMENTATION

#define STB_TRUETYPE_IMPLEMENTATION

Function Documentation

◆ packRect()

bool packRect ( std::vector< Shelf > & shelves,
int atlasW,
int atlasH,
int w,
int h,
int & outX,
int & outY )
static

Try to pack a rectangle into the atlas using shelf-packing.

Parameters
shelvesCurrent shelf state.
atlasWAtlas width in pixels.
atlasHAtlas height in pixels.
wRectangle width to pack.
hRectangle height to pack.
outXOutput x position in the atlas.
outYOutput y position in the atlas.
Returns
true if the rectangle was packed successfully.
Here is the caller graph for this function: