Starting repo

This commit is contained in:
HKU Aaron Account 2025-08-28 14:52:41 +02:00
commit d318b72c3b
5 changed files with 113 additions and 0 deletions

11
src/CMakeLists.txt Normal file
View file

@ -0,0 +1,11 @@
add_executable(low-level_setup
main.cpp
)
target_link_libraries(low-level_setup
PUBLIC
ImGui-SFML::ImGui-SFML
)
# Do we need this?
# include(Install.cmake)

43
src/main.cpp Normal file
View file

@ -0,0 +1,43 @@
#include "imgui.h"
#include "imgui-SFML.h"
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow window;
window.create(sf::VideoMode({ 1280, 720 }), "My window");
window.setFramerateLimit(60);
window.setVerticalSyncEnabled(true);
if (!ImGui::SFML::Init(window))
return -1;
sf::Clock deltaClock;
while (window.isOpen())
{
float deltaTime = deltaClock.restart().asSeconds();
// Event Polling
while (const std::optional event = window.pollEvent())
{
ImGui::SFML::ProcessEvent(window, *event);
// "close requested" event: we close the window
if (event->is<sf::Event::Closed>())
window.close();
}
// Update
ImGui::SFML::Update(window, deltaClock.restart());
// ImGui::ShowDemoWindow();
// Render
window.clear();
ImGui::SFML::Render(window);
window.display();
}
return 0;
}