From 3dc3dfc1e4836e45022dd882b645664b1a2ceb4a Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 1 Feb 2025 15:23:29 +0500 Subject: feat: floor (wip) --- src/floor.cpp | 6 ++++++ src/floor.hpp | 15 +++++++++++++++ src/main.cpp | 4 ++++ 3 files changed, 25 insertions(+) create mode 100644 src/floor.cpp create mode 100644 src/floor.hpp (limited to 'src') 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 #include +#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 event = window.pollEvent()) { -- cgit v1.2.3