diff --git a/bocm b/bocm index dcbf992..d16bcd6 100755 Binary files a/bocm and b/bocm differ diff --git a/bocm.c b/bocm.c index b4a16b5..e523428 100644 --- a/bocm.c +++ b/bocm.c @@ -1,5 +1,5 @@ -#include #include "functions.c" +#include "loop.c" int main(int argc, char** argv) { initWindow(); diff --git a/functions.c b/functions.c index 6376031..5e52700 100644 --- a/functions.c +++ b/functions.c @@ -4,7 +4,7 @@ SDL_Window* window; SDL_Renderer* renderer; SDL_Surface* surface; SDL_Texture* texture; -SDL_Event event; + const int screenWidth = 800; const int screenHeight = 600; @@ -54,19 +54,6 @@ int presentLogo(void){ return 0; } -int windowLoop(void){ - while (1) { - SDL_PollEvent(&event); - if (event.type == SDL_QUIT) { - break; - } - - loadBackgroundColor(); - presentLogo(); - } - return 0; -} - int destroy(void){ SDL_DestroyTexture(texture); SDL_DestroyRenderer(renderer); diff --git a/loop.c b/loop.c new file mode 100644 index 0000000..e9d7c2d --- /dev/null +++ b/loop.c @@ -0,0 +1,18 @@ +#include + +SDL_Event event; + +int windowLoop(void){ + while (1) { + SDL_PollEvent(&event); + if (event.type == SDL_QUIT) { + break; + } + + loadBackgroundColor(); + presentLogo(); + } + return 0; +} + +