summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-02-01 15:23:29 +0500
committerilotterytea <iltsu@alright.party>2025-02-01 15:23:29 +0500
commit3dc3dfc1e4836e45022dd882b645664b1a2ceb4a (patch)
tree607592e6088aec4cccf239d7194482a0a139855e /src
parent98bb51185eb053d56052ad9feb3420c258dbb601 (diff)
feat: floor (wip)
Diffstat (limited to 'src')
-rw-r--r--src/floor.cpp6
-rw-r--r--src/floor.hpp15
-rw-r--r--src/main.cpp4
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()) {