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

Pages: [1]
1
Those would be good optimizations, but I see no real performance decrease (on release, /02) unless changing fonts about 100 times per second. Even with multiple fonts, the memory only rises depending on the amount of text and whether it's changing, but does not exceed 2 GB in the most extreme cases with multiple fonts. I still get a steady 500fps when changing font size every frame.

Overall I think there's not much need for optimization other than maybe increasing the max cache size a bit. The way I see it, if there's a fix in place and there's performance issues, it's a user flaw. But if there's no fix at all and memory leaks persist, it's an SFML flaw.

2
Graphics / sf::Text::setCharacterSize() memory leak, maybe (Solved)
« on: March 15, 2023, 08:18:48 pm »
I made a gui and I am using a slider to change the font size of a text. The memory remains stable when not changing the value, but every time it's changed it increases memory use. So if I swing the slider back and forth a bit, it eats up my 32GB memory very quickly.

Is it supposed to do this and should I be scaling instead of changing the character size?


Edit: I fixed this issue by using this font function in sf::Text::setCharacterSize()

void Font::clearPages() const
{
    // Reset members
    m_pages.clear();
    std::vector<std::uint8_t>().swap(m_pixelBuffer);
}

3
Graphics / Re: OpenGL call failed in RenderTarget.cpp?
« on: February 04, 2023, 07:30:41 pm »
I've found that if using Visual Studio it will tend to throw this error for absolutely no reason even while the given views display properly. Try rebuilding the entire project or rescanning the solution so any precompiled nonsense errors get tossed.

4
Graphics / Re: sf::Angle not working?
« on: January 23, 2023, 10:54:51 am »
That explanation wasn't in the .hpp file. But I got it, next time I find a function that takes a class as a parameter, I'll search for whatever unmentioned functions return that class.

5
Graphics / Re: sf::Angle not working?
« on: January 22, 2023, 07:18:46 am »
Oh ok. It's just that the Angle constructor is extremely unclear about what to give it and the only one it shows a parameter for is the private constructor that says "float degrees". The word "angle" always refers to degrees anyways so I don't know what the deal is.

6
switch the event.mouseButton.button because the MouseButtonPressed and Released events don't distinguish between mouse buttons. It'll even trigger if you press mouse buttons 3 (scroll wheel) and 4 and 5 (the ones on the side).

As for your condition it looks like you're just checking whether the cursor was moved since you last clicked. There's also a MouseMoved event you can use to set a flag, then just check that flag if you click.

7
Graphics / sf::Angle not working?
« on: January 22, 2023, 02:32:00 am »
I'm trying to follow an sf::View tutorial by exploiter, but I can't use the rotate() method at all. (version 2.5.1 on Windows 10 x64)

Here's what I've tried so far:

   sf::Angle angle(180.f); // error
   sf::Angle angle2 = 180.f; // error
   sf::Angle angle3; // No method to change this thing's angle

   view.rotate(180.f); // error
   view.rotate(angle3); // works but can't change angle
   view.setRotation(180.f); // same thing

Can't we just use a float or something, or am I not supposed to use this method?

8
Any progress on this yet? I honestly don't see any benefit to using a single text object since you can't adjust the position of the next character without messing with the sf::Text object itself. My other idea was to use whitespace as filler for each newline and remove a space for each character entered, but that's hard to make work.

Pages: [1]