diff options
| author | ilotterytea <iltsu@alright.party> | 2025-02-01 14:54:55 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-02-01 14:55:37 +0500 |
| commit | 98bb51185eb053d56052ad9feb3420c258dbb601 (patch) | |
| tree | 81562188ef0015a6c903bb985ab864014b80f4b4 /src/main.cpp | |
| parent | f1ab4e564ea83540e513e1266c87e31c0eedf073 (diff) | |
upd: we migrated to sfml/imgui/c++ stack (project rewrite)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..5bb7884 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,37 @@ +#include <imgui-SFML.h> +#include <imgui.h> + +#include <SFML/Graphics/RenderWindow.hpp> +#include <SFML/System/Clock.hpp> +#include <SFML/Window/Event.hpp> +#include <SFML/Window/VideoMode.hpp> +#include <optional> + +int main() { + sf::RenderWindow window(sf::VideoMode({800, 600}), "sillyeditor"); + window.setFramerateLimit(60); + ImGui::SFML::Init(window); + + sf::Clock deltaClock; + while (window.isOpen()) { + while (const std::optional<sf::Event> event = window.pollEvent()) { + if (event.has_value()) { + sf::Event e = event.value(); + ImGui::SFML::ProcessEvent(window, e); + } + + if (event->is<sf::Event::Closed>()) { + window.close(); + } + } + + ImGui::SFML::Update(window, deltaClock.restart()); + + window.clear(); + + ImGui::SFML::Render(window); + window.display(); + } + + return 0; +}
\ No newline at end of file |
