OS: any SFML version: git build:DEBUG TGUI version:git build:DEBUG Error: SEGFAULT
#include <SFML/Window.hpp>
#include <TGUI/TGUI.hpp>
class Form
{
public:
Form(sf::RenderWindow& window): m_Gui(window)
{
window.getSize();
}
~Form() {}
private:
tgui::Gui m_Gui;
};
class Game
{
public:
Game()
: m_Window(sf::VideoMode::getDesktopMode(), "...", sf::Style::Default)
, m_Form(m_Window)
{
/*stuff*/
}
~Game() {}
private:
Form m_Form; //<----this is the error! Even though m_Window is initialized before m_Form
sf::RenderWindow m_Window; //<---- the order is decided by the members' position in the header
tgui::Gui m_Gui; //[-WReorder] or [-Wall] weren't set in my project so I didn't notice.
};
int main()
{
Game game;
return 0;
}