TTF_Init went well and the TTF_OpenFont works fine. But when drawing, no text is rendered? Is there something special like screen location?
The code looks kinda like this:
void GameFramework :: DrawString (const char *text)
{
if (text == NULL || font == NULL || DrawingContext == NULL)
{
return;
}
SDL_Color color = {1.0, 1.0, 1.0};
SDL_Surface *text_surface = TTF_RenderText_Solid (font, text, color);
if (text_surface != NULL)
{
SDL_Rect OutputRect;
OutputRect.x = 10;
OutputRect.y = 10;
SDL_BlitSurface(text_surface, NULL, DrawingContext, &OutputRect);
SDL_FreeSurface(text_surface);
}
}
Thanks
The code looks kinda like this:
void GameFramework :: DrawString (const char *text)
{
if (text == NULL || font == NULL || DrawingContext == NULL)
{
return;
}
SDL_Color color = {1.0, 1.0, 1.0};
SDL_Surface *text_surface = TTF_RenderText_Solid (font, text, color);
if (text_surface != NULL)
{
SDL_Rect OutputRect;
OutputRect.x = 10;
OutputRect.y = 10;
SDL_BlitSurface(text_surface, NULL, DrawingContext, &OutputRect);
SDL_FreeSurface(text_surface);
}
}
Thanks