Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - texus

#1576
Something is seriously wrong, I just don't know what.
The crash could be explained if you use gcc 4.8 though. Libraries aren't compatible between different compiler versions.
But that means that you had to recompile sfml yourself, right? Because the precompiled binary of sfml is also gcc 4.7. And if you compiled it yourself then it would expain the error that cmake can't find sfml because you have to copy the lib folder from the build folder to the root folder.

QuoteI see that:
...
That explains why people still download v0.5 while the v0.6-beta was released over 2 weeks ago. Damn caching. Fixed.
#1577
The program works fine for me. I just removed the sfml dependencies (freetype and stuff) from the linker as they aren't needed, they are linked inside the sfml libraries.
But with the compiler that comes with code blocks and the libraries downloaded from my site everything seems to work.

Wait, did you say gcc 4.8?
Did you recompile tgui? Because the precompiled version is for gcc 4.7.

I have an unrelated question. When you visit https://tgui.eu/download/, do you see the v0.6 alpha2 versions with a line through them, or do you see the downloadable v0.6 beta?
#1578
Could you send me the .cbp file?
Maybe I can find the mistake that way.
#1579
With what compiler?
Where does it crash (use the debugger to get the location and call stack)?
Are you linking to the static or dynamic libraries?
Does it occur in debug or release mode?

I can't help without enough information. I either need to reproduce the issue (which I probably won't with such simple code) or get enough information in the hope that I can tell you what the problem is.

If you are on windows then you should first of all make sure that when you link tgui statically then you also link sfml statically (or link both dynamically), and make sure that when in release mode you link both sfml and tgui in release mode (and in debug mode link the debug libs of both).
#1580
The download page contains the following link: Download TGUI v0.6 beta (with precompiled GCC 4.7 TDM (SJLJ) 32 bits libraries for SFML 2.1).
That is for the compiler that comes with CodeBlocks.
#1581
First of all, the CodeBlocks MinGW compiler is the 4.8.1 TDM version.

I assume that you selected "MinGW Makefiles" instead of the one for CodeBlocks?
In this case no tgui.cpb will be generated, but it will generate a Makefile instead. You need to run "mingw32-make" from the command line in that folder (the mingw-make program has to be in the PATH variable).

By the way, the download page contains precompiled binaries for that compiler.
#1582
You have an iterator 'it' that points to the first element in the list.
The advance function will increment it a few times so that the iterator then points to the x'th element in the list.

If you want quick answers then I think you would better google for it. I'm sure you'll find enough explanation at cplusplus.com.
#1583
The changes have been made. Your image will no longer be stretched with the latest version.
#1584
For auto, you probably find better explanations when googling for it.
You can find some info here for example: https://www.cprogramming.com/c++11/c++11-auto-decltype-return-value-after-function.html

For the toAnsiString you can look at its documentation.
When writing to a file (or in the terminal), you can only use std::string. The sf::String class doesn't provide the '<<' operator which would allow it to be written to the file. So you need to convert the sf::String to an std::string first (which is what the toAnsiString function does) before writing it to the file. The reason I use sf::String instead of std::string is because sf::String also supports unicode characters, but as long as you don't use them then you don't have to worry about it and just use toAnsiString to get the std::string.
#1585
I just placed comments in your code to make it more clear. But if there is still something specifically that you don't understand then just let me know.

buffers.push_back(sf::SoundBuffer());  // Create a new SoundBuffer an put it in the back of the list
buffers.back().loadFromFile(name + ".wav");  // Initialize the just created SoundBuffer

sounds.push_back(sf::Sound());  // Create a new Sound object and put it in the back of the list
sounds.back().setBuffer(buffers.back());  // Tell the just created Sound object that it should use the just created SoundBuffer

-------------------------
auto& items = listBox->getItems();  // Get a list of all the items in the list box (auto is std::vector<sf::String> here)
for (auto it = items.cbegin(); it != items.cend(); ++it)  // Use an iterator to loop over the list of items (auto is a std::vector<sf::String>::const_iterator here)
{
    ofile << it->toAnsiString() << std::endl;  // Write the item in the list to the file ( '*it' is a sf::String, and to write to a file you need an std::string which is why you need the toAnsiString function )
}

#1586
I have done some tests and you will have your solution tomorrow, worst case on sunday.

The texture coordinates in GUI.conf are slightly off though. You will need this to get the desired effect.
    NormalImage_L  = "Normal.png" (0, 0, 10, 39)
    NormalImage_M  = "Normal.png" (10, 0, 100, 39)
    NormalImage_R  = "Normal.png" (110, 0, 10, 39)
    HoverImage_L   = "Hover.png"  (0, 0, 10, 39)
    HoverImage_M   = "Hover.png"  (10, 0, 100, 39)
    HoverImage_R   = "Hover.png"  (110, 0, 10, 39)
    DownImage_L    = "Down.png"   (0, 0, 10, 39)
    DownImage_M    = "Down.png"   (10, 0, 100, 39)
    DownImage_R    = "Down.png"   (110, 0, 10, 39)


I have attached a preview of what the button will look like after I make the changes and when you put the above lines in your config file.
#1587
I see.
But I can't fix that at this point.

SplitImage is added so that you can have buttons with rounded corners, or special corners like yours, so that they don't get stretched. What actually happens is that the left and right image get drawn at the normal size, but the middle image is stretched to fill the whole image.

What you want is that I draw the middle image multiple times instead of stretching it to fill the button. I looked into the possibility, but it requires me to rewrite an important part of the code which I am not going to do short before the release of v0.6. And even if I could change it, I probably don't have the time for it.

I wish I could help, but I cannot make the change now, it will probably be something for v0.6.x.
University has started again, so I can't really make any promises about progress until the end of June.


Edit: I will have the possibility to try changing my code this weekend, but I make no guarantees.
I'm planning on launching the v0.6-beta version at the end this weekend. If the fix isn't in that version then you shouldn't expect it anymore (in the near future).
#1588
I have attached the output of what I get when using your code and config file.

Could you explain the problem in more detail, because I don't see anything wrong.
#1589
Can you also send me the image so that I can test it for myself?
#1590
DotNet / Re: Linux usage
24 September 2013, 17:47:45
I finally had the time to continue with the c# version again.
You were right, if you download the right files then there aren't really any problems with 64bit.

I needed to add two files to get it working. Putting it in app.exe.config doesn't seem to work.
The tutorial will be updated in the next few days to contain this information.

sfmlnet-graphics-2.dll.config
<configuration>
<dllmap dll="csfml-window-2" target="/usr/local/lib/libcsfml-window.so.2.1"/>
<dllmap dll="csfml-graphics-2" target="/usr/local/lib/libcsfml-graphics.so.2.1"/>
</configuration>


Tao.OpenGl.dll.config
<configuration>
<dllmap dll="opengl32.dll" target="/usr/lib/libGL.so.1.2.0"/>
</configuration>
#1591
QuoteI can compile SFML fine.
And it uses the same compiler (h:/MinGW/bin/gcc.exe) ?

The error occurs even before my cmake script gets run which indicates that the problem lies with the compiler or cmake. So I'm even more surprised that you can compile one project and not the other.
#1592
QuoteUsing the CodeBlocks MinGW compiler
QuoteCheck for working C compiler: h:/MinGW/bin/gcc.exe
That is not the compiler from CodeBlocks!
The one from CodeBlocks is in the 'C:\Program Files\CodeBlocks\MinGW\bin' folder.

Why are you on the H drive instead of the C drive anyway? It isn't really the default.
#1593
Right after you started this topic I installed the same CMake version and tried recompiling tgui.
I didn't have any problems, so if reinstalling doesn't work then I have absolutely no idea what could be causing this.

Are you able to compile sfml, or is this only a problem with tgui?
#1594
I doubt that it is going to be a bug in tgui if it happens on all widgets and not in only one widget.
If it doesn't work with sf::Text then there is nothing I can do. All widgets just use sf::Text internally.
#1595
After reading that issue again, it might have been fixed already.
Does it only happen when creating a tgui::Label or also when just drawing an sf::Text? Because I can only help in the first situation.
#1596
This is a limitation in sfml.

"Currently, fonts are always anti-aliased and this cannot be changed."
https://github.com/LaurentGomila/SFML/issues/254
#1597
I didn't have much time earlier, so just ignore my previous answer.

I'm now blocking the update function when the window isn't focused, so any animation (at this point only the flashing caret) will be paused as long as the window is unfocused.

There is only one small thing, I don't know if the window is going to be focused when the program starts. This is something that might be OS-dependant (and I only tested on linux so far) so let me know when the caret doesn't flicker at all.
#1598
This is actually your responsibility. Your program is still running in the background.

When the window loses focus you should ignore all events (and don't call gui.handleEvent) until the window gets focused again.
#1599
You could try reinstalling cmake.
I've seen strange stuff before on windows that was solved by either reinstalling codeblocks or cmake. Although I never had this particular error before.
#1600
I can't test it now, I'm not at home.

Try with your old code and look at what I changed in the part where callback.id is 2.
Maybe I just removed a little too much.