e12b581fc8
This includes: * Change the Makefile so we can build the source with SDL * Create a config file for all global variables * Initialize a simple game loop to see something on the screen * Stub for building a drawing lib * Modify the README a little bit
18 lines
362 B
C
18 lines
362 B
C
|
|
#include "SDL.h"
|
|
#include "draw.h"
|
|
#include "config.h"
|
|
|
|
|
|
void drawPixel(int x, int y, int color) {
|
|
unsigned int *p = (unsigned int*)screen->pixels;
|
|
int lineOffset = y * (screen->pitch/4);
|
|
p[lineOffset+x] = color;
|
|
}
|
|
|
|
void drawScreen() {
|
|
Uint32 black = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);
|
|
drawPixel(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, black);
|
|
}
|
|
|