Mercurial > hg > pub > prymula > com
annotate lamertetris/sources/text.C @ 10:4dc186728822
immposiblerush-0.230919-2
author | prymula <prymula76@outlook.com> |
---|---|
date | Sun, 04 Feb 2024 23:27:00 +0100 |
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 } |