#include <stdio.h>
#include "SDL/SDL.h"
#include "SDL/SDL_ttf.h"
#define DINGOO_BUTTON_UP SDLK_UP
#define DINGOO_BUTTON_DOWN SDLK_DOWN
#define DINGOO_BUTTON_RIGHT SDLK_RIGHT
#define DINGOO_BUTTON_LEFT SDLK_LEFT
#define DINGOO_BUTTON_R SDLK_BACKSPACE
#define DINGOO_BUTTON_L SDLK_TAB
#define DINGOO_BUTTON_A SDLK_LCTRL
#define DINGOO_BUTTON_B SDLK_LALT
#define DINGOO_BUTTON_X SDLK_SPACE
#define DINGOO_BUTTON_Y SDLK_LSHIFT
#define DINGOO_BUTTON_SELECT SDLK_ESCAPE
#define DINGOO_BUTTON_START SDLK_RETURN
#define DINGOO_BUTTON_END SDLK_UNKNOWN
void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination)
{
//Make a temporary rectangle to hold the offsets
SDL_Rect offset;
//Give the offsets to the rectangle
offset.x = x;
offset.y = y;
//Blut the surface
SDL_BlitSurface( source, NULL, destination, &offset );
}
int main(int argc, char** argv)
{
SDL_Surface *background = NULL;
SDL_Surface *message = NULL;
SDL_Surface *screen = NULL;
SDL_Event event;
TTF_Font *font;
font=TTF_OpenFont("font.ttf", 12);
SDL_Color textColor = { 255, 255, 255 };
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Set up screen
screen = SDL_SetVideoMode( 320, 240, 16, SDL_SWSURFACE );
//SDL_ShowCursor( SDL_DISABLE );
message = TTF_RenderText_Solid( font, "The quick brown fox jumps over the lazy dog", textColor );
apply_surface( 0, 0, message, screen );
SDL_Flip(screen);
SDL_Delay( 8000 );
SDL_FreeSurface( message );
//Close the font that was used
TTF_CloseFont( font );
//Quit SDL_ttf
TTF_Quit();
//Quit SDL
SDL_Quit();
return 0;
}
this prints out nothing D: What am I doing wrong?