comparison lamertetris/sources/text.C @ 0:2787f5e749ae

INIT
author prymula <prymula76@outlook.com>
date Thu, 21 Sep 2023 22:33:57 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:2787f5e749ae
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 }