Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mkawick

macrumors newbie
Original poster
Oct 21, 2008
6
0
Vancouver, BC
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.