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

Author Topic: TGUI: a c++ GUI for SFML (with Form Builder)  (Read 287568 times)

0 Members and 5 Guests are viewing this topic.

TechRogue

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
TGUI: a c++ GUI for SFML
« Reply #30 on: March 17, 2012, 10:33:41 pm »
Ah, okay. I'm a little unclear on the intricacies of const-correctness, so I wasn't sure if there was any reason to do it that way.

basic_prog

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: TGUI: a c++ GUI for SFML
« Reply #31 on: March 27, 2012, 04:51:00 pm »
I can't get your example code to work. It compiles fine but i get linking errors ... I added all the libs... (system,window,graphics,and libtgui.a)
I'm using Code::Blocks , gcc 4.6
C:\TGUI\lib\32-bit\libtgui.a(Panel.o):Panel.cpp|| undefined reference to `_imp___ZN2sf4FontaSERKS0_'|
C:\TGUI\lib\32-bit\libtgui.a(Panel.o):Panel.cpp|| undefined reference to `__gxx_personality_sj0'|
C:\TGUI\lib\32-bit\libtgui.a(Panel.o):Panel.cpp|| undefined reference to `_Unwind_SjLj_Register'|
C:\TGUI\lib\32-bit\libtgui.a(Panel.o):Panel.cpp|| undefined reference to `_imp___ZTVN2sf4TextE'|
C:\TGUI\lib\32-bit\libtgui.a(Panel.o):Panel.cpp|| undefined reference to `_imp___ZTVN2sf11VertexArrayE'|
 :-[
Downloaded last version of TGUI

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML
« Reply #32 on: March 27, 2012, 05:56:03 pm »
I don't have much time right now to search the problem.
I just checked and the library was build with gcc 4.4.1, maybe that's causing the problem.

For now, until I get the time to test my 32-bit lib, you will have to build it yourself.
If you don't want to build it then you can always just add the source files directly to your project.

To build it yourself:
- Make an empty project and add all my cpp files.
- Make sure the include directory is set.
- Don't link to any library.
- Set the build type to "Static library" (Project>Properties>Build targets>Type)
- You might need to compile with -fPic.

I will try to test my 32-bit lib as soon as possible (which means hopefully this weekend).
TGUI: C++ SFML GUI

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: TGUI: a c++ GUI for SFML
« Reply #33 on: March 27, 2012, 06:16:45 pm »
This kind of error happens when you mix two incompatible versions of gcc. Sadly, on Windows there are two versions that are equally maintained and used: the DW2 version and the SJLJ version.
Laurent Gomila - SFML developer

Silvah

  • Guest
Re: TGUI: a c++ GUI for SFML
« Reply #34 on: March 27, 2012, 06:47:46 pm »
This kind of error happens when you mix two incompatible versions of gcc. Sadly, on Windows there are two versions that are equally maintained and used: the DW2 version and the SJLJ version.
If only it were this simple. Exception handling method is probably the least annoying issue, as it causes linking errors when something is wrong. At least sometimes.
As an aside, this distinction applies to every platform on which GCC supports zero-cost exceptions (on these it doesn't, setjmp/longjmp is the only choice). It just happens that on Windows there's no consensus on which unwinding to use.

There are some more possible differences between GCC builds (these affect Windows only):
  • runtime library: mingw-rt + w32api vs MinGW-w64
  • GCC threading model: win32 vs posix
  • GCC version: 4.7+ vs older versions - GCC 4.7 for Windows on IA-32 starts to use different calling convention for non-static member functions by default (thiscall, as most other compilers on Windows do), which is incompatible with the one used by older versions (cdecl).
Hence, if you don't want to take chances, it's best to have compiled everything with the very same compiler.
« Last Edit: March 27, 2012, 06:50:31 pm by Silvah »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: TGUI: a c++ GUI for SFML
« Reply #35 on: March 27, 2012, 07:01:54 pm »
This is even worse that what I thought. I have no idea which precompiled versions of SFML 2.0 for gcc on Windows I should provide >:(
Laurent Gomila - SFML developer

Silvah

  • Guest
Re: TGUI: a c++ GUI for SFML
« Reply #36 on: March 27, 2012, 07:20:44 pm »
This is even worse that what I thought.
Yup. And I didn't even say anything about third-party patches which also can make the thing incompatible with everything else. Therefore...

I have no idea which precompiled versions of SFML 2.0 for gcc on Windows I should provide >:(
...I think the best way is to provide no precompiled versions at all. Just provide clear building instructions, then even inexperienced users should be able to build it themselves.

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Re: TGUI: a c++ GUI for SFML
« Reply #37 on: March 27, 2012, 07:50:57 pm »
I guess you could set it up for gcc so all they have to do is CD to the folder in the command prompt and run make? The most complex part of that is ensuring that make is in your path.
« Last Edit: March 27, 2012, 08:01:10 pm by MorleyDev »
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: TGUI: a c++ GUI for SFML
« Reply #38 on: March 27, 2012, 08:10:55 pm »
The problem is that CMake create build files with absolute paths inside. To distribute something as simple as "set PATH ... & make & make install" I would have to create specific makefiles.

I think I'll provide a release for the version of gcc shipped with Code::Blocks, since many people are using it (especially beginners). Don't know about other versions.
Laurent Gomila - SFML developer

basic_prog

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: TGUI: a c++ GUI for SFML
« Reply #39 on: March 28, 2012, 10:11:28 am »
This kind of error happens when you mix two incompatible versions of gcc. Sadly, on Windows there are two versions that are equally maintained and used: the DW2 version and the SJLJ version.
Thx, i didn't know that  :)
I just checked and the library was build with gcc 4.4.1, maybe that's causing the problem.

For now, until I get the time to test my 32-bit lib, you will have to build it yourself.
If you don't want to build it then you can always just add the source files directly to your project.

I'll build it and see what happens. thx

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML
« Reply #40 on: April 05, 2012, 10:24:03 pm »
Good news: the first version of the Form Builder is ready!




I have also made some changes to TGUI. The most important are:
- Mac OS X support
- Label has a callback on click
- All object have a getSize function
- Some bug fixes

And now the bad news: the form builder is far from being finished.
- You can already drag objects around, but for scaling you will still have to change the property manually.
- A lot could be improved if my gui would be able to create child windows, which won't happen anywhere soon.
- There is no load function yet. You can only save a file.
- Negative positions don't work.
- I just noticed that you can't remove an object.
- There are no binaries for Linux yet.

EDIT: I just fixed the most important problem: you couldn't remove objects.
I also made it possible to set an object to a negative position and I provided linux binaries.
The other problems will have to wait until I release TGUI v0.4.
« Last Edit: April 07, 2012, 08:31:16 pm by texus »
TGUI: C++ SFML GUI

edge87

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #41 on: April 19, 2012, 03:42:39 pm »
Has anybody tried to use this with the latest SFML 2.0 RC ? It compiles correctly but after the init function it seg faults.

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #42 on: April 19, 2012, 05:11:45 pm »
I wish I could try if it works with the rc version, but I can't even get it to compile and I don't have the time to find out what I am doing wrong.

There were hardly any modifications in sfml2 since the version that can be found on my site. Does it work with this version?
If so then you can use that version until I have the time to compile a new lib.

If you really can't get it to work then without segfaults then you should temporary use the tgui source code directly in your project instead of using the library.
TGUI: C++ SFML GUI

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #43 on: May 05, 2012, 07:21:19 pm »
The Form Builder didn't work correctly, so I couldn't delay my release till July.
TGUI v0.4 is not finished, but you can already download the latest revision (which is just as stable as v0.3.6 was).

Changes:
- The Panel struct has been rewritten and has been tested.
- Objects can be moved to the back or to the front.
- In the Form Builder v0.2, save and delete buttons now work correctly and a load button was added.
- You can also easily scale the objects in the new Form Builder.
- In the new TGUI Object Files v0.2, you can add panels and use multiline comments.

Because most of my library files didn't work, I now have a complete new way of distributing.

The latest version can now be downloaded on GitHub.
You will have to build it yourself with CMake. I have already started with writing tutorials.

If you are using Mac OS X then you will have to wait a little bit for the libraries.
Until I finish my CMake script you will have to use the source code directly.

The Form Builder is only provided for Windows, but the source code is also provided, so you can use it on Linux or Mac too.
« Last Edit: May 15, 2012, 03:39:27 pm by texus »
TGUI: C++ SFML GUI

argoneus

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: TGUI: a c++ GUI for SFML (with Form Builder)
« Reply #44 on: May 20, 2012, 12:12:06 pm »
Hi, I've got a question. I'm a newbie to SFML and I want clarification on one thing. TGUI includes everything SFML has, correct? E.g. if I create a TGUI window, I can use it in the same way I would use a SFML one? What if I want to use stuff such as SFML/Network.hpp, or even OpenGL?

And one more thing: Is it possible to change the textures/colors if I don't like the default ones?

Thanks a lot.
« Last Edit: May 20, 2012, 12:15:34 pm by argoneus »

 

anything