I am trying print text to the screen but I am getting compile errors. here is the code I am working on.
SDL_Surface* screen;
SDL_Surface* fontSurface;
SDL_Color fColor;
SDL_Rect fontRect;
SDL_Event event;
TTF_Font* font;
void fontInit()
{
TTF_Init();
font = TTF_OpenFont("arail.ttf", 12);
fColor.r = 255;
fColor.g = 255;
fColor.b = 255;
}
void printF(char* c, int x, int y)
{
fontSurface = TTF_RenderText_Solid(font, c, fColor);
fontRect.x = x;
fontRect.y = y;
SDL_BlitSurface(fontSurface, NULL, screen, &fontRect);
int SDL_Flip(SDL_Surface * screen);
}