diff --git a/README.md b/README.md index 1c9201f..875dd39 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

-DurkGame is an extention of SDL2. There will be different object types to inherit from in the future such as `CharacterBody`s, `RigidBody`s, and `PhysicsBody`s. Eventually, I plan to also implement handy mathematical functions such as pathfinding and raycasting. +DurkGame is an extention of SDL2. There will be different object types to inherit from in the future such as `CharacterBody`s, `StaticBody`s, and `PhysicsBody`s. Eventually, I plan to also implement handy mathematical functions such as pathfinding and raycasting. # Documentation I don't have a documentation page yet, but I plan on making one soon. @@ -13,30 +13,32 @@ In the very least, here is a basic window setup program using DurkGame: const dk::math::Vector2 WIN_SIZE = { 800, 600 }; -int main() { - dk::init(); - - dk::RenderWindow window(WIN_SIZE, "DurkGame App"); - dk::time::Clock clock; - - bool run = true; - while (run) { - float deltaTime = clock.tick(60) / 1000.0f; - for (const auto& event : window.getEvents()) { - switch (event.type) { - case SDL_QUIT: - run = false; - break; - } - } - - window.fill({ 40, 40, 40 }); - window.flip(); - } - - dk::quit(); - return 0; +int main() { + dk::init(); + dk::RenderWindow window(WIN_SIZE, "DurkGame App"); + dk::time::Clock clock; + + bool done = false; + while (!done) { + double deltaTime = clock.tick(60); + + for (const auto& event : window.getEvents()) { + if (event.type == DK_QUIT) { + done = true; + } else if (event.type == DK_KEYDOWN) { + if (event.key.keysym.sym == DKK_ESCAPE) { + done = true; + } + } + } + + window.fill({ 40, 40, 40 }); + window.flip(); + } + + dk::quit(); + return EXIT_SUCCESS; } ```