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

Author Topic: SFGUI (0.4.0 released)  (Read 350182 times)

0 Members and 1 Guest are viewing this topic.

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI
« Reply #330 on: November 02, 2012, 01:23:29 am »
The notebook is actually way more complex it seems(the ListBox I imagine is vcl style one, just bunch of indices and strings like current combobox) and could do for what I want to do but it's less than ideal.

Also, are shared ptr some sort of special gui ptrs or are they 'just' a shared ptr that can be used as replacement for boost one(I'm avoiding boost atm).

And yes, people are scared because sfgui is written by pros. :)
« Last Edit: November 02, 2012, 01:30:44 am by FRex »
Back to C++ gamedev with SFML in May 2023

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI
« Reply #331 on: November 02, 2012, 01:44:17 am »
sfg::SharedPtr was written as a replacement for boost::shared_ptr because we wanted to chop off the dependency and the 20 seconds of extra build time because of it. Don't use SharedPtr if you have another implementation available (use C++11 for this if you can). When I implemented it, I leafed over boost code to get the idea of how it worked and implemented our own without all the stuff SFGUI doesn't need like concurrency support, move support etc.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI
« Reply #332 on: November 02, 2012, 01:46:26 am »
I'm avoiding c++11 as well ;D but thanks.
Back to C++ gamedev with SFML in May 2023

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: SFGUI
« Reply #333 on: November 02, 2012, 08:19:33 am »
Quote
Tank told me he was working on it... a while ago... I don't know what the status on it is right now . He'll have to get back to you on that.
I didn't get beyond the planning stage. :( Like binary said, a lot of things are going on at the moment, and I can't dedicate much/any time to SFGUI.

However one thing's for sure: I'll need it too (again) at a point of time in the future. So either someone will have already contributed one or I'll have to do it myself (again). ;) But don't expect this to happen soon.

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI
« Reply #334 on: November 02, 2012, 01:18:24 pm »
I'm using notebook for that now but it's a bit wasteful, one shared ptr wasted per page, every page has same box as content and I check index and load data from indexed container into widgets in box on tab changes.

Is the notebook bug with adding new pages at runtime fixed in last source?
« Last Edit: November 02, 2012, 03:26:05 pm by FRex »
Back to C++ gamedev with SFML in May 2023

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI
« Reply #335 on: November 02, 2012, 04:51:17 pm »
Here's code for bug, new tabs get added on top of first one untill the notebook gets resized, then they fly into their proper places.
//include sfml and sfg
sfg::Notebook::Ptr notebook;
sfg::Button::Ptr adder;
void add()
{
        notebook->AppendPage(adder,sfg::Label::Create("new"));
}
int main(int argc,char * argv[])
{
        sfg::SFGUI gui;
        sf::RenderWindow app(sf::VideoMode(600,600),"notebook bug");
        notebook=sfg::Notebook::Create();
        adder=sfg::Button::Create("add new");
        adder->GetSignal(sfg::Widget::OnLeftClick).Connect(&add);
        notebook->AppendPage(adder,sfg::Label::Create("first"));
        sfg::Desktop desktop;
        sfg::Window::Ptr window=sfg::Window::Create();
        window->Add(notebook);
        desktop.Add(window);
        sf::Clock clock;
        while(app.isOpen())
        {
                sf::Event eve;
                while(app.pollEvent(eve))
                {
                        if(eve.type==sf::Event::Closed) app.close();
                        desktop.HandleEvent(eve);
                }
                desktop.Update(clock.restart().asSeconds());
                app.clear();
                app.resetGLStates();
                gui.Display(app);
                app.display();
        }
}
Back to C++ gamedev with SFML in May 2023

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: SFGUI
« Reply #336 on: November 02, 2012, 11:45:32 pm »
Could you do us a favor and post that bug report to http://redmine.boxbox.org/projects/sfgui/issues? SFML's forum isn't really the right place for it. ;)

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI
« Reply #337 on: November 02, 2012, 11:49:33 pm »
I have rather old .dlls and .libs of everything so I'm not sure if it reproduces with lastest source.
Back to C++ gamedev with SFML in May 2023

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: SFGUI
« Reply #338 on: November 03, 2012, 02:07:20 am »
Then try downloading the nightly builds from the website. They are only one commit behind.

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI
« Reply #339 on: November 03, 2012, 02:12:51 am »
No. I'm getting my free vs 2010 pro, have to do it already, and then I'll redownload libs I use, bake the dlls and then try. I'll get back to you about that in around an hour tops. ;)
One does not simply install new compiler and bake his dlls.
Yes, the bug is present with last sources. I added ticket to issues : http://redmine.boxbox.org/issues/538
« Last Edit: November 03, 2012, 04:24:38 am by FRex »
Back to C++ gamedev with SFML in May 2023

firefly2442

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: SFGUI
« Reply #340 on: November 04, 2012, 04:21:28 am »
I'm getting the following error when adding the necessary include file in my project:

Code: [Select]
fatal error: SFGUI/SFGUI.hpp: No such file or directory
The relevant section in my CMake file for SFGUI is:

Code: [Select]
find_package(SFGUI REQUIRED)
if(SFGUI_FOUND)
  include_directories(${SFGUI_INCLUDE_DIR})
  target_link_libraries(${EXECUTABLE_NAME} ${SFGUI_LIBRARY})
endif()

I was under the impression that the include_directories adds these directories so that the generated solution can identify directories to search in order to find the necessary includes.  I'm guessing it's something simple but... any ideas?

Thanks. :)

firefly2442

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: SFGUI
« Reply #341 on: November 04, 2012, 06:55:19 pm »
Fixed it.  There's a bug in FindSFGUI.cmake.  The variable SFGUI_FOUND is set to false at the beginning but never toggled to true.  I posted a bug in the tracker.

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI
« Reply #342 on: November 05, 2012, 11:07:24 pm »
Is it normal for program to crash when closed using console? I thought it's default deja vu font acting like sfml's old default font but after removing it, I still get crash on exit.
Back to C++ gamedev with SFML in May 2023

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI
« Reply #343 on: November 06, 2012, 12:26:43 am »
Is it normal for program to crash when closed using console? I thought it's default deja vu font acting like sfml's old default font but after removing it, I still get crash on exit.

You have to elaborate more on this. How does this program function? What do you mean by "closed using console"? What does "crash" mean?

We designed the built-in font to not cause the same problems as the SFML one, that was the whole idea after all. As such it is unlikely that it is the cause for your problem.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI
« Reply #344 on: November 06, 2012, 12:41:24 am »
by closing using console i mean pressing the X on the console window when project is compiled as console application
int main()
{
sfg::SFGUI eh;
std::cin.get();//press console window X to crash or enter to quit alright
}
Quote
I thought it's default deja vu font acting like sfml's old default font but after removing it, I still get crash on exit.
removing it = I recompiled without default font so it was not it but since error is like with default font I thought your is same
crash means a very exciting msvc 2010 window saying:
Quote
Unhandled exception at 0x08e9a4cc in EddysTestbed10.exe: 0xC0000005: Access violation reading location 0x000007f0.
and error pointing to disassembly(exactly what default font did in sfml)
I also got(in my older project) similar errro by a bad singleton pattern, using pointer there solved it, so i dug into your code but you are using a pointer for the singleton already.. maybe because it's a smart ptr there is a problem, or maybe im doing something wrong

But since:
Quote
Closing the console is not a clean way to end a program. Closing a program by an external source is never clean, only controlled termination within the program itself is clean.
I'm not sure if it's not meant to happen which is not a big dealreally, just change settings so that console doesn't show up since it's for debugging purposes only anyway(could also redirect the cout and cerr somewhere reasonable).
Back to C++ gamedev with SFML in May 2023