IsaqueFD ...
Ae vai um exemplo maneiro !
#include <SDL/SDL.h>
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
int main (void)
{
printf("Iniciando a SDL de video..."
if ( SDL_Init(SDL_INIT_VIDEO) == -1)
{
printf("ERRO!\n"
exit(-1);
}
printf("OK\n"
SDL_Surface *LO_Tela;
LO_Tela = SDL_SetVideoMode( 512, 384, 16, SDL_HWSURFACE | SDL_DOUBLEBUF );
rectangleRGBA( LO_Tela, 100, 100, 200, 200, 0, 128, 255, 255); // Desenhando quadrado
SDL_UpdateRect(LO_Tela, 0, 0, 512, 384); // Atualizando a tela gráfica
sleep(5); // espera 5 segundo e sai do programa
printf("Fechando SDL..."
SDL_Quit();
printf("OK\n"
printf("Programa encerrado!\n"
exit(0);
}
Esse exemplo acima cira uma janela utilizando a biblioteca SDL, salve este código como teste.c e pra compilar crie um arquivo chamado makefile e salve esse código abaixo:
ARQUIVOS = teste.c
OBJETOS = teste.o
DIRINCLUDE = -I/usr/include
DIRLIB = -L/usr/lib
PARLIB = -lSDL -lSDL_gfx -lSDL_ttf
COMPILADOR = gcc
all: linkar compilar limpar
linkar: $(ARQUIVOS)
$(COMPILADOR) -c $(ARQUIVOS) $(DIRINCLUDE)
compilar: $(ARQUIVOS)
$(COMPILADOR) $(OBJETOS) $(DIRINCLUDE) $(DIRLIB) $(PARLIB) -o teste
limpar:
rm -f *.o
Depois use make para compilar e divirta-se !
:]