Mercurial > hg > pub > prymula > com
annotate lamertetris/sources/text.C @ 22:b0c59d056e73
colorsmemory - typo
author | Przemyslaw <prymula76@outlook.com> |
---|---|
date | Sun, 31 Mar 2024 22:53:32 +0200 |
parents | 2787f5e749ae |
children |
rev | line source |
---|---|
0 | 1 #include "text.h" |
2 | |
3 Text::Text(){} | |
4 | |
5 SDL_Surface* Text::loadFromRenderedText( std::string textureText, SDL_Color textColor, TTF_Font* font) | |
6 { | |
7 | |
8 SDL_Surface* textSurface = TTF_RenderText_Solid( font, textureText.c_str(), textColor); | |
9 if( textSurface != NULL ) | |
10 { | |
11 mWidth = textSurface->w; | |
12 mHeight = textSurface->h; | |
13 } | |
14 else | |
15 { | |
16 printf( "Unable to render text surface! SDL_ttf Error: %s\n", TTF_GetError() ); | |
17 } | |
18 | |
19 return textSurface; | |
20 } |