#include "mxfont.h" struct SDL_Font *fnt = 0; void render(SDL_Surface *front) { SDL_PrintText(front, fnt, 0,0,SDL_MapRGB(front->format, 255, 255, 255), "Hello World with MXF"); } extern int SDL_main(int argc, char **argv) { SDL_Surface *front = 0; SDL_Event e; int active = 1; if(SDL_Init(SDL_INIT_VIDEO) < 0) return -1; front = SDL_SetVideoMode(480,272,0,0); if(!front) return -1; fnt = SDL_InitFont("t.mxf"); while(active == 1) { if(SDL_PollEvent(&e)) { switch(e.type) { case SDL_QUIT: active = 0; break; } } SDL_FillRect(front, 0, 0); render(front); SDL_UpdateRect(front, 0,0, front->w, front->h); } SDL_FreeSurface(front); SDL_FreeFont(fnt); SDL_Quit(); return 0; }