I'm making a text based game using SDL2 and SDL_TTF. I just started working with TTF, and I've noticed there is some kind of character limit regarding how much text you can render at a time! I can only render about 15 characters, after that, (16 characters or higher) the screen is just blank.
I really want to render large bodies of text (multiple sentences at a time) so how do I overcome this issue? For rendering text, I have this function:
void drawDialog(const char* content) {
//Draws a dialog box with set text
TTF_Font* font = TTF_OpenFont("assets/times.ttf", 900);
SDL_Color textColor = { 255, 255, 255 };
SDL_Surface* message = TTF_RenderText_Solid(font, content, textColor);
SDL_Texture* tex;
SDL_Rect destRect;
destRect.x = 50;
destRect.y = 730;
destRect.w = 200;
destRect.h = 30;
tex = SDL_CreateTextureFromSurface(renderer, message);
SDL_FreeSurface(message);
SDL_RenderCopy(renderer, tex, NULL, &destRect);
SDL_RenderPresent(renderer);
}
So, any advice for overcoming this limit? Any help would be greatly appreciated!