SFML community forums

Help => General => Topic started by: Shuvi22 on December 03, 2022, 06:54:26 pm

Title: CodeLite. Problem with SMFL + Imgui + ImguiSMFL
Post by: Shuvi22 on December 03, 2022, 06:54:26 pm
Hi all. There was such a problem: when trying to create and draw completely imgui-details, the application crashes (without any error. Just a standard random set of a number as an exit code). The .dll libraries are added and the SFML window appears for a split second without imgui(without imgui everything works fine). The imgui and imguiSFML code has not changed, except for adding the Glad header to imgui-SFML.h. I hope someone can help me with this problem

The code:
#include "imgui.h"
#include "imgui-SFML.h"


#include <SFML/Graphics/CircleShape.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/Window/Event.hpp>

int main() {
    sf::RenderWindow window(sf::VideoMode(640, 480), "ImGui + SFML = <3");
    window.setFramerateLimit(60);
    ImGui::SFML::Init(window);

    sf::Clock deltaClock;

    while (window.isOpen()) {
        sf::Event event;
        while (window.pollEvent(event)) {
            ImGui::SFML::ProcessEvent(window, event);

            if (event.type == sf::Event::Closed) {
                window.close();
            }
        }

        ImGui::SFML::Update(window, deltaClock.restart());

        ImGui::Begin("Hello, world!");
        ImGui::Button("Look at this pretty button");
        ImGui::End();

        window.clear();
        ImGui::SFML::Render(window);
        window.display();
    }

    ImGui::SFML::Shutdown();
}
 

Screenshots:
Title: Re: CodeLite. Problem with SMFL + Imgui + ImguiSMFL
Post by: eXpl0it3r on December 06, 2022, 08:51:16 am
Attach a debugger and get the call stack of the crash, plus additional information on how it crashed.