From: Matthew Owens Date: Thu, 1 Oct 2020 14:58:20 +0000 (+0100) Subject: removed accidentally added o file X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=8b95af60c7b16f7322f4c8a33e1a2c1972fad487;p=pong.git removed accidentally added o file --- diff --git a/src/main.c b/src/main.c index fb05761..9ce4d31 100644 --- a/src/main.c +++ b/src/main.c @@ -5,6 +5,11 @@ #include #include "timestep.h" +typedef struct Vec2d { + int x; + int y; +} Vec2d; + typedef struct Colour { Uint8 r; Uint8 g; @@ -21,7 +26,7 @@ static SDL_Window *window = NULL; static SDL_Renderer *renderer = NULL; static const Vec2d windowSize = { 1920, 1080 }; static bool quit = false; -static const float speed = 5.f; +static const float speed = 20.f; static const Colour bgClr = { 0x1c, 0x1c, 0x1c, 0xff }; Box pad, ball; @@ -81,7 +86,8 @@ static bool init() return false; } - renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); + renderer = SDL_CreateRenderer(window, -1, + SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); if(renderer == NULL) { COUT_ERR("Couldn't create renderer! SDL_Error: %s", SDL_GetError()); @@ -99,12 +105,13 @@ static void update() int nPhysUpdates = 0; const Uint8 *keyStates = SDL_GetKeyboardState(NULL); - ts_update(); while(SDL_PollEvent(&e) != 0){ if(e.type == SDL_QUIT) { quit = true; } } + ts_update(); + while(ts_phys_required(nPhysUpdates)){ paddle_update(keyStates, 1.f); nPhysUpdates++; diff --git a/src/main.o b/src/main.o deleted file mode 100644 index 667fbd2..0000000 Binary files a/src/main.o and /dev/null differ