hi
try this
#include <stdlib.h>
#include “SDL.h”
#include “SDL_ttf.h”
TTF_Font *Fuente1;
SDL_Color Color1;
SDL_Surface *text_surface;
SDL_Rect Rectangulo;
SDL_Surface *Pantalla;
SDL_Event event;
int Salir;
int Orden;
int main (int argc, char *argv[]){
if(SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO ) < 0) {
printf(“Unable to init SDL: %s\n”, SDL_GetError());
exit(1);
}
Pantalla = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE );
if ( Pantalla == NULL ) {
fprintf(stderr, "Couldn't set video mode: %s\n",
SDL_GetError());
exit(1);
}
Orden=TTF_Init();
if (Orden<0) { printf("\nError inicializando TTF"); }
Fuente1=TTF_OpenFont(“Fuentes/arial.ttf”,26);
if (Fuente1 == NULL) { printf("\nTTF_OpenFont: %s\n", TTF_GetError()); }
TTF_SetFontStyle(Fuente1,TTF_STYLE_BOLD);
Color1.r=200;
Color1.g=70;
Color1.b=50;
text_surface=TTF_RenderText_Solid(Fuente1,“Hello World!”,Color1);
if (text_surface==NULL){
printf("\nError: %s\n", TTF_GetError());
}
Rectangulo.x=100;
Rectangulo.y=100;
Rectangulo.w=text_surface->w;
Rectangulo.h=text_surface->h;
SDL_FillRect(Pantalla, NULL, SDL_MapRGB(Pantalla->format, 128, 128, 128));
SDL_BlitSurface(text_surface, NULL, Pantalla, &Rectangulo);
SDL_UpdateRect(Pantalla,0, 0, 0, 0);
Salir=0;
while (Salir<1)
{
while (SDL_PollEvent(&event))
{
if (event.type==SDL_KEYDOWN) Salir=1;
}
}
return 0;
}
ppap_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.com/