#include #include #include #include #include int main() { sf::RenderWindow window(sf::VideoMode(640, 480), "imgui-sfml-demo"); window.setVerticalSyncEnabled(true); ImGui::SFML::Init(window); window.resetGLStates(); // call it if you only draw ImGui. Otherwise not needed. sf::Clock deltaClock; while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { ImGui::SFML::ProcessEvent(event); if (event.type == sf::Event::Closed) { window.close(); } } ImGui::SFML::Update(window, deltaClock.restart()); window.clear(sf::Color::Transparent); // fill background with color ImGui::ShowDemoWindow(); ImGui::SFML::Render(window); window.display(); } ImGui::SFML::Shutdown(); }