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
draw.cpp File Reference
#include "./asw/modules/draw.h"
#include <SDL3/SDL.h>
#include <SDL3_image/SDL_image.h>
#include <SDL3_ttf/SDL_ttf.h>
#include <algorithm>
#include <array>
#include <cmath>
#include <numbers>
#include <string_view>
#include <vector>
#include "./asw/modules/display.h"
#include "./asw/modules/util.h"
#include "./lru_cache.h"
Include dependency graph for draw.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{draw.cpp}::TextCacheKey
 
struct  anonymous_namespace{draw.cpp}::TextKeyView
 
struct  anonymous_namespace{draw.cpp}::TextCacheEntry
 
struct  anonymous_namespace{draw.cpp}::TextKeyHash
 
struct  anonymous_namespace{draw.cpp}::TextKeyEqual
 
struct  anonymous_namespace{draw.cpp}::ScaledFontKey
 
struct  anonymous_namespace{draw.cpp}::ScaledFontKeyHash
 

Namespaces

namespace  anonymous_namespace{draw.cpp}
 

Functions

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

Variables

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