ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
anonymous_namespace{draw.cpp} Namespace Reference

Classes

struct  ScaledFontKey
 
struct  ScaledFontKeyHash
 
struct  TextCacheEntry
 
struct  TextCacheKey
 
struct  TextKeyEqual
 
struct  TextKeyHash
 
struct  TextKeyView
 

Functions

TextKeyView view (const TextCacheKey &key)
 
const TextKeyView & view (const TextKeyView &key)
 
uint32_t text_render_scale (asw::Renderer *renderer, bool pixel_font)
 
TTF_Font * get_scaled_font (const asw::Font &font, uint32_t font_generation, uint32_t render_scale)
 
asw::Texture make_cached_texture (SDL_Texture *texture)
 

Variables

constexpr uint32_t RENDER_SCALE_ONE = 100
 
constexpr std::size_t SCALED_FONT_LIMIT = 32
 
asw::detail::LruCache< ScaledFontKey, asw::Font, ScaledFontKeyHash, std::equal_to<> > scaled_fonts (SCALED_FONT_LIMIT)
 
constexpr std::size_t TEXT_CACHE_LIMIT = 256
 
asw::detail::LruCache< TextCacheKey, TextCacheEntry, TextKeyHash, TextKeyEqual > text_cache (TEXT_CACHE_LIMIT)
 

Function Documentation

◆ get_scaled_font()

TTF_Font * anonymous_namespace{draw.cpp}::get_scaled_font ( const asw::Font & font,
uint32_t font_generation,
uint32_t render_scale )

Definition at line 135 of file draw.cpp.

◆ make_cached_texture()

asw::Texture anonymous_namespace{draw.cpp}::make_cached_texture ( SDL_Texture * texture)

Definition at line 162 of file draw.cpp.

◆ text_render_scale()

uint32_t anonymous_namespace{draw.cpp}::text_render_scale ( asw::Renderer * renderer,
bool pixel_font )

Definition at line 119 of file draw.cpp.

◆ view() [1/2]

TextKeyView anonymous_namespace{draw.cpp}::view ( const TextCacheKey & key)

Definition at line 43 of file draw.cpp.

◆ view() [2/2]

const TextKeyView & anonymous_namespace{draw.cpp}::view ( const TextKeyView & key)

Definition at line 48 of file draw.cpp.

Variable Documentation

◆ RENDER_SCALE_ONE

uint32_t anonymous_namespace{draw.cpp}::RENDER_SCALE_ONE = 100
constexpr

Definition at line 105 of file draw.cpp.

◆ SCALED_FONT_LIMIT

std::size_t anonymous_namespace{draw.cpp}::SCALED_FONT_LIMIT = 32
constexpr

Definition at line 107 of file draw.cpp.

◆ scaled_fonts

asw::detail::LruCache< ScaledFontKey, asw::Font, ScaledFontKeyHash, std::equal_to<> > anonymous_namespace{draw.cpp}::scaled_fonts(SCALED_FONT_LIMIT) ( SCALED_FONT_LIMIT )

◆ text_cache

◆ TEXT_CACHE_LIMIT

std::size_t anonymous_namespace{draw.cpp}::TEXT_CACHE_LIMIT = 256
constexpr

Definition at line 111 of file draw.cpp.