/* * Project: SDL * Demo Code * This demo simply inits the library. * * Joseph M. Robertson, jmr, jmrobert5@home.com * * Copyright(c) 2001, Joseph M. Robertson. * This code protected by the GNU Public License. * See the LICENSE file or http://www.gnu.org for details. */ /* * build code * gcc -c init.c -I/usr/include/SDL * gcc -o init init.o -lSDL -lpthread */ #include "SDL.h" /* All SDL App's need this */ #include int main() { printf("Initializing SDL.\n"); /* Initialize defaults, Video and Audio */ if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) { printf("Could not initialize SDL: %s.\n", SDL_GetError()); exit(-1); } printf("SDL initialized.\n"); printf("Quitting SDL.\n"); /* Shutdown all subsystems */ SDL_Quit(); printf("Quitting....\n"); exit(0); }