diff options
| -rw-r--r-- | src/floor.cpp | 6 | ||||
| -rw-r--r-- | src/floor.hpp | 15 | ||||
| -rw-r--r-- | src/main.cpp | 4 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/floor.cpp b/src/floor.cpp new file mode 100644 index 0000000..fac9ec6 --- /dev/null +++ b/src/floor.cpp @@ -0,0 +1,6 @@ +#include "floor.hpp" + +namespace silly::editor { + const int Floor::get_width() const { return this->width; } + const int Floor::get_height() const { return this->height; } +}
\ No newline at end of file diff --git a/src/floor.hpp b/src/floor.hpp new file mode 100644 index 0000000..6389dff --- /dev/null +++ b/src/floor.hpp @@ -0,0 +1,15 @@ +#pragma once + +namespace silly::editor { + class Floor { + public: + Floor(int width, int height) : width(width), height(height) {} + ~Floor() = default; + + const int get_width() const; + const int get_height() const; + + private: + int width, height; + }; +}
\ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 5bb7884..e58fc06 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,11 +7,15 @@ #include <SFML/Window/VideoMode.hpp> #include <optional> +#include "floor.hpp" + int main() { sf::RenderWindow window(sf::VideoMode({800, 600}), "sillyeditor"); window.setFramerateLimit(60); ImGui::SFML::Init(window); + silly::editor::Floor floor(30, 30); + sf::Clock deltaClock; while (window.isOpen()) { while (const std::optional<sf::Event> event = window.pollEvent()) { |
