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

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.


Messages - texus

Pages: 1 2 3 [4] 5 6 ... 34
46
General / Re: TGUI Bad Alloc using example code
« on: November 02, 2017, 06:31:27 pm »
I don't know what could cause it.
Did you build TGUI yourself with cmake of did you download VS2015 binaries it from the website?
What compiler are you using?
Which SFML version are you using?

47
Window / Android sends Delete event instead of Backspace
« on: October 22, 2017, 11:37:21 am »
SFML maps the AKEYCODE_DEL event to Keyboard::Delete (WindowImplAndroid.cpp#L623) while this is actually the backspace key. The real delete key is AKEYCODE_FORWARD_DEL.

Is this a bug or was there a reason to do this? I find it strange that I just worked around this in my code when I encountered it a few years ago. Maybe I saw this post back then and though that it would be fixed, but it looks like it was forgotten.

48
Make sure everything is compatible. There exists no prebuild TGUI 0.7 libraries compatible with SFML 2.2 and MinGW 4.7.1 to my knowledge, so you should have had to build the TGUI libraries yourself.

Maybe you can try narrowing down the error. Start with an empty main.cpp file, see if it occurs when including only <SFML/Graphics.hpp> or whether you only get errors when including <TGUI/TGUI.hpp>

Your main.cpp file isn't even compatible with the compiler you use. The errors contain "main.cpp|136|error: 'to_string' is not a member of 'std'". MinGW TDM (the one that comes with codeblocks) lacks the std::to_string function. So you should definitely start with a smaller main.cpp first to only get the relevant errors and check where they occur.

If you find that the error ONLY happens when you include TGUI stuff and there is no problem with an SFML example code, then it might be that your compiler is no longer supported. Although I have automated tests that compile TGUI and its examples with GCC 4.7 on linux, the oldest MinGW version tested with TGUI is 4.9.

49
Graphics / Re: Texture stops updating midway through
« on: August 22, 2017, 07:01:24 pm »
Every line contains WINSIZE_X pixels and 4 bytes per pixel. You are correctly multiplying x by 4, but forgot to also multiply WINSIZE_X by 4.
E.g. the second line starts at byte 3200 and not at byte 800, thus the pixels should be set like this:
pixels[(y*WINSIZE_X*4)+(4*x)]       = 255; // R
pixels[(y*WINSIZE_X*4)+(4*x)+1]     = 255; // G
pixels[(y*WINSIZE_X*4)+(4*x)+2]     = 0; // B
pixels[(y*WINSIZE_X*4)+(4*x)+3]     = 200; // A

50
Window / Re: Read-Only Textbox with Scrollbar
« on: July 22, 2017, 11:05:11 am »
Quote
is it still actively maintained?
More or less, it hasn't existed for a long time yet. There used to exist a TGUI.Net port for tgui 0.6 several years ago, but it was discontinued because I didn't have the time to keep it up to date with the big rewrites going on in the c++ version. Now that the api of tgui 0.8 is getting more stable, I created the current TGUI.Net binding.
It is only since last weekend that the builds have been automated so that any change I make to TGUI.Net is downloadable on the website within a few minutes. Before that, the last (and only) release that was made dated from February. I expect to be updating it more regularly now, to only keep it at most a few commits behind on the c++ version. And the more people using TGUI.Net, the more incentive I will also have to keep the .Net version up to date.

51
Window / Re: Read-Only Textbox with Scrollbar
« on: July 21, 2017, 10:35:51 am »
Or use a gui library.
I don't know how well the other libraries support it, but TGUI has a TextBox that can be made read only. It only supports a vertical scrollbar.

52
DotNet / Re: Install TGUI.NET
« on: July 12, 2017, 07:43:45 am »
The official CSFML dlls link statically to SFML. I have so far only been successful at getting TGUI.Net to work when everything is linked dynamically.

Otherwise both CSFML and TGUI link statically to SFML, so the SFML code would be duplicated in both the CSFML and CTGUI dll. This always lead to crashes in my tests, while linking dynamically worked fine.

I also can't guarantee that TGUI.Net can work if you use a different version of the SFML libraries, even if they link dynamically.

53
DotNet / Re: Install TGUI.NET
« on: July 11, 2017, 10:48:16 pm »
TGUI.Net isn't very well tested yet (as I don't have much experience with .Net myself). I'm actually planning to work on it again this weekend to bring it back up to date with the c++ version (which just received a few large changes), I'll have another look at how to install it then.
Make sure your project compiles as x64 and not x32 or Any CPU. The error could actually mean more than just the ctgui dll missing, it can also occurs when a dependency isn't there (e.g. tgui.dll missing). Did you also copy the sfml dlls? You have to use the exact files in the zip, both the .Net dlls for the References and the dlls that have to be copied next to the exe, you can't use any other SFML version. If you copied all dlls next to the exe, then I currently can't help much.

TGUI has its own forum at forum.tgui.eu btw.

54
Using views may work, but it will require a lot of testing to get the code right (as I need to deal with intersecting areas and having objects still drawn at the right location after changing the view). I'm currently going to leave it as is, I'm not looking forward to waste my time working around something that has to be fixed afterwards anyway (as #846 also uses glScissors). I can always go back to shipping modified SFML versions until then if I have to.

55
For other opengl states I understand that, but don't I need the scissor rectangle if I only want part of the SFML rendering to show up on the screen? For instance if I don't want text drawn in an edit box to be drawn outside of the box when the text is too long? Or is there another method to clip the SFML rendering?

56
I found a case in which text rendering is broken. After spending most of my day minimizing the code, I came up with the following minimal example.
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

    sf::Font font;
    font.loadFromFile("DejaVuSans.ttf");

    sf::Text text("Hello", font, 17);

    font.getGlyph('g', 130, false); // A character that does not occur in the text

    for (const auto c : text.getString())
        font.getGlyph(c, 130, false);

    text.setCharacterSize(130);

    sf::Text anotherText("Hello", font, 17); // Same string
    anotherText.setCharacterSize(130);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();

        glEnable(GL_SCISSOR_TEST);
        GLint m_scissor[4] = {};
        glGetIntegerv(GL_SCISSOR_BOX, m_scissor);
        glScissor(0, 150, 400, 450);

        // Clear again with different color just to show clipping area
        window.clear(sf::Color::Blue);

        window.draw(anotherText);

        glScissor(m_scissor[0], m_scissor[1], m_scissor[2], m_scissor[3]);

        window.display();
    }

    return EXIT_SUCCESS;
}

Instead of showing "Hello", it shows only the top part of some letters (the "L"s are ccompletely gone). I've attached a screenshot showing the issue.

I traced back at which SFML version this problem was introduced and I found that it only started since 6b71456. SFML versions before this commit show the text correctly.

It looks like glScissor has an effect on the internal font rendering, calling glDisable(GL_SCISSOR_TEST) at the start of Font::loadGlyph and calling glEnable(GL_SCISSOR_TEST) at the end of the function seems to fix the issue.

57
General / Re: [TGUI] EditBox validator (regex)
« on: July 03, 2017, 11:08:32 am »
Yeah, for further questions about TGUI it's probably better to ask them on forum.tgui.eu.

The regex for edit box has a rather limited functionality. If you can match the string with std::regex then pasting it in edit box while the regex is set should also work. But because the regex has to be valid at any time, you can't type in the edit box because any incomplete ip address will be rejected. It would be better to allow the user to type any combination of numbers and dots and processing the value yourself later.

58
General / Re: [TGUI] Disabled image property
« on: July 02, 2017, 11:07:30 pm »
Apparently that feature was only added in tgui 0.8-dev, according to the commit history it was one of the first big features added after I released 0.7.
If upgrading is not an option then a workaround could be to call button->getRenderer()->setNormalTexture(...) each time you disable or enable it (to swap which image is displayed).
Also, even though 0.8-dev has BackgroundColorDisabled and TextureDisabled properties, they are not being used yet by the default themes. So you will have to edit the theme file yourself (and provide your own image if you use TextureDisabled).

There is currently no list of properties outside the source code. Most properties are used in one of the 3 theme files shipped with TGUI, for the others you will have to keep checking the source code (either from the src folder or from the tests).
I intended to put a list on the website some time ago already, but I haven't had the time yet. It currently has low priority.

59
General / Re: Issues with Audio module
« on: May 26, 2017, 12:53:18 pm »
The tutorial you followed is outdated. Look at the dependencies mentioned in the getting started tutorial instead (the tutorial is not for eclipse, but the dependencies are the same).

60
No, I don't have a gamepad here.

Pages: 1 2 3 [4] 5 6 ... 34