#include #include "pixel.h" enum direction {up=0, down=1, left=2, right=3}; struct Player { enum direction dir; int points; SDL_Color color; int posx, posy; }; struct Player player1, player2; void initPlayers() { SDL_Surface *screen = SDL_GetVideoSurface(); player1.dir = left; player1.posx = screen->w / 3 * 2; player1.posy = screen->h / 2; player1.points = 0; player1.color.r = 255; player1.color.g = 0; player1.color.b = 0; player2.dir = right; player2.posx = screen->w / 3; player2.posy = screen->h / 2; player2.points = 0; player2.color.r = 0; player2.color.g = 255; player2.color.b = 0; } int main(int argc, char **argv) { SDL_Init(SDL_INIT_EVERYTHING); SDL_Surface *screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE); initPlayers(); int quit = 0; SDL_Event event; while(!quit) { if(SDL_PollEvent(&event)) { if(event.type == SDL_QUIT) { quit = 1; } } SDL_Delay(10); } SDL_Quit(); return 0; }