SDL-ttf

I come up wit this very simpe procedure to put tex on a surface using
SDL_ttf lib.

SDL_Color textcol,int X,int Y, int ptsize, int renderstyle)
{
TTF_Font *font;
SDL_Surface *text, *temp;
SDL_Color forecol;
SDL_Rect dstrect;
/
Default is black and white /
forecol = &textcol;
/
Open the font file with the requested point size /
font = TTF_OpenFont(fontname, ptsize);
TTF_SetFontStyle(font, renderstyle);
/
Render and center the message */
text = TTF_RenderText_Solid(font,message,forecol);
/
Blit the text surface */
SDL_UpdateRect(screen, 0, 0, 0, 0);
temp = SDL_DisplayFormat(text);
dstrect.x = X - text ->w/2;
dstrect.y = Y - text ->h/2;
dstrect.w = text->w;
dstrect.h = text->h;
SDL_BlitSurface(text, NULL, screen, &dstrect);
SDL_UpdateRects(screen, 1, &dstrect);
}

It is basicly a showfont ripoff. But now how do i get text of the screen^)

I come up wit this very simpe procedure to put tex on a surface using
SDL_ttf lib.

[snipped]

It is basicly a showfont ripoff. But now how do i get text of the screen^)

The same way you would for any other image on the screen - just copy the
background onto the screen to fill the old text area.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment