diff --git a/Makefile b/Makefile index 348d549..f9b84b6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ source := source/*.cpp -executable_name := demo_pelota2 +executable_name := demo_pelotas2 windows: g++ $(source) -Wall -lmingw32 -lws2_32 -lSDL2main -lSDL2 -o $(executable_name).exe diff --git a/source/defines.h b/source/defines.h index 689f8c0..078622e 100644 --- a/source/defines.h +++ b/source/defines.h @@ -1,5 +1,6 @@ #pragma once +#define WINDOW_CAPTION "demo_pelotas2" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 #define BALL_SIZE 8 diff --git a/source/main.cpp b/source/main.cpp index 07f6d66..d12fcb7 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -10,7 +10,7 @@ SDL_Renderer *renderer = NULL; SDL_Event *event; Texture *texture = nullptr; std::vector balls; -int test[7] = {1, 10, 100, 500, 1000, 10000, 100000}; +int test[8] = {1, 10, 100, 500, 1000, 10000, 50000, 100000}; bool shouldExit = false; Uint32 ticks = 0; @@ -77,7 +77,7 @@ bool init() } // Create window - window = SDL_CreateWindow("Demo Pelotas 2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH * 2, SCREEN_HEIGHT * 2, SDL_WINDOW_SHOWN); + window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH * 2, SCREEN_HEIGHT * 2, SDL_WINDOW_SHOWN); if (window == NULL) { printf("Window could not be created! SDL Error: %s\n", SDL_GetError()); @@ -192,6 +192,11 @@ void checkEvents() { initBalls(6); } + + if (event->key.keysym.sym == SDLK_8) + { + initBalls(7); + } } } }