- Treballant en algo de UI

This commit is contained in:
2023-06-06 11:55:47 +02:00
parent f7f6131a79
commit 0460efc64a
8 changed files with 81 additions and 16 deletions

View File

@@ -16,7 +16,7 @@ namespace game
int main(int argc, char *argv[])
{
game::init();
input::init();
input::init(draw::getZoom());
static unsigned int current_ticks = SDL_GetTicks();
@@ -35,6 +35,10 @@ int main(int argc, char *argv[])
{
input::updateKeypressed(e.key.keysym.scancode);
}
if (e.type==SDL_MOUSEBUTTONUP)
{
input::updateClk(e.button.button);
}
}
if (SDL_GetTicks()-current_ticks >= game::ticks_per_frame)
@@ -42,6 +46,7 @@ int main(int argc, char *argv[])
if (!game::loop()) should_exit = true;
input::updateKey(SDL_SCANCODE_UNKNOWN);
input::updateKeypressed(SDL_SCANCODE_UNKNOWN);
input::updateClk(0);
current_ticks = SDL_GetTicks();
}
}