STLL
0.0
Simple Text Layouting Library
|
a class to output layouts using SDL More...
Classes | |
class | ImageDrawer_c |
class used to encapsulate image drawing More... | |
Public Member Functions | |
showSDL (void) | |
void | showLayout (const TextLayout_c &l, int sx, int sy, SDL_Surface *s, SubPixelArrangement sp=SUBP_NONE, ImageDrawer_c *images=0) |
display a single layout More... | |
void | setGamma (uint8_t gamma=22) |
update the gamma value used for output More... | |
void | setClipRect (uint16_t x=0, uint16_t y=0, uint16_t w=std::numeric_limits< uint16_t >::max(), uint16_t h=std::numeric_limits< uint16_t >::max()) |
set the clip rectangle More... | |
void | trimCache (size_t num) |
trims the font cache down to a maximal number of entries More... | |
a class to output layouts using SDL
To output layouts using this class, create an object of it and then use the showLayout Function to output the layout.
G | the gamma calculation class to use... normally you don't need to change this, keep the default |
|
inline |
|
inline |
set the clip rectangle
Default for the clip rectangle is as big as possible, output is always clipped to the target surface size. Defaults for this function are set in such a way that calling it without arguments clears the clip rectangle
x | x-coordinate of upper left corner |
y | y-coordinate of upper left corner |
w | width of the clip rectangle |
h | height of clip rectangle |
|
inline |
update the gamma value used for output
Default value for the class is 22, which is good for sRGB output, which should be your default for high quality output. See Gamma for details.
gamma | the new gamma value in 1/10th units. Use 22 for sRGB and 10 for normal linear |
|
inline |
display a single layout
l | layout to draw |
sx | x position on the target surface in 1/64th pixels |
sy | y position on the target surface in 1/64th pixels |
s | target surface |
sp | which kind of sub-pixel positioning do you want? |
images | a pointer to an image drawer class that is used to draw the images, when you give a nullptr here, no images will be drawn |
gamma | the gamma value of the target surface s in 0.1 increments. Screen surfaces usually have a gamma of 2.2, if you blit to a intermediate surface use a gamma of one, but then you should take care of gamma correction when blitting with alpha values. |
|
inline |
trims the font cache down to a maximal number of entries
the SDL output module keeps a cache of rendered glyphs to speed up the process of outputting layouts. This cache may get too big on memory. To keep things within limits you can call this function to remove entries. If there are more entries in the cache the ones that were used the longest time ago are removed
num | maximal number of entries, e.g. 0 completely empties the cache |