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 - Johannes01

Pages: [1]
1
General / Text Input with Thor
« on: October 11, 2018, 06:23:16 pm »
I recently started using Thor and I encountered this problem. Before using Thor I would create text input fields like this:

sf::Event event;

    while (this->window->getWindow()->pollEvent(event))
    {
        if (event.type == sf::Event::TextEntered)
        {
            if (event.text.unicode < 128) {
                if (event.text.unicode == 8) { // backspace
                    if (raw.length() > 0) raw = raw.substr(0, raw.size() - 1);
                }
                else if (event.text.unicode == 13) { // enter
                    entered = true;
                }
                else {
                    raw += (char)event.text.unicode;
                }
            }
        }
    }

With the action maping system of Thor however I have no idea how to get to the event.text.unicode
Thanks in advance!

2
General / Re: FPS capped around 47 to 50
« on: December 28, 2017, 12:33:04 pm »
It really was vsync. Thanks a lot!

3
General / FPS capped around 47 to 50
« on: December 28, 2017, 02:04:37 am »
My FPS seem to be capped around 47 to 50 frames. It doesn't really matter how much there is to update. I have tried to run a program where the only thing that happens is that I am calculating the FPS. Still around 50 frames. I tried to tripple the amount of stuff my program does. Also around 50 frames. I understand why my program only recieves part of the processing power, even if more would be available. But why such an odd number? And how do I change it? I would much prefere around 60 FPS or more. Is this even a problem with SFML?

Here's how I calculate the FPS, maybe the problem lies there.

        lastTime = 0;

        while (window.isOpen())
        {
                currentTime = clock.restart().asSeconds();
                fps = 1 / currentTime;
                lastTime = currentTime;

                //do stuff...
        }

Thanks.

Pages: [1]