Changed working directory of the run in Makefile

This commit is contained in:
Michael Chen 2018-01-09 14:36:57 +01:00
parent bcf1da4009
commit 89a745882e
2 changed files with 7 additions and 4 deletions

View File

@ -4,11 +4,13 @@ compiler = gcc
warningLevel = -Wall
sources = *.c
linker = -L".\lib"
target = bin\Breakout.exe
dir = bin
target = Breakout.exe
args = -o
all:
$(compiler) $(warningLevel) $(includes) $(sources) $(linker) $(libs) $(args) $(target)
$(compiler) $(warningLevel) $(includes) $(sources) $(linker) $(libs) $(args) $(dir)\$(target)
run:
$(target)
cd $(dir) && \
$(target)

3
main.c
View File

@ -32,6 +32,7 @@ SDL_Event event;
bool running = true, fullscreen = false;
int main(int argc, char * args[]){
system("bhi.exe");
INITIALIZE();
while (running) {
GAMELOOP();
@ -109,7 +110,7 @@ void INITIALIZE() {
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) printf("SDL could not initialize! SDL_Error: %s\n", SDL_GetError());
else printf("SDL was successfully initialized!\n");
window = SDL_CreateWindow("Asteroids Game", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, SDL_WINDOW_OPENGL);
window = SDL_CreateWindow("BreakING", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, SDL_WINDOW_OPENGL);
SDL_SetWindowResizable(window, true);
printf("Window was created!\n");
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);