Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: CodeLite. Problem with SMFL + Imgui + ImguiSMFL  (Read 916 times)

0 Members and 1 Guest are viewing this topic.

Shuvi22

  • Newbie
  • *
  • Posts: 6
    • View Profile
CodeLite. Problem with SMFL + Imgui + ImguiSMFL
« 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:
« Last Edit: December 03, 2022, 07:00:17 pm by Shuvi22 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: CodeLite. Problem with SMFL + Imgui + ImguiSMFL
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/