1
General / Re: My SFML project uses large amounts of RAM and the font displays half of text
« on: February 25, 2015, 04:18:07 pm »
(bump)
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.
It automatically handles conversions from/to ANSI and wide strings, so that you can work with standard string classes and still be compatible with functions taking a sf::String.
sf::String s;
std::string s1 = s; // automatically converted to ANSI string
Holy crap. Are you creating multiple RenderTextures and then drawing to all of them each frame?Yes. I have a grid of render textures across the screen. I redraw the render textures when they get off screen. It allows me to make a very heavily starred procedurally generated background at 6% CPU perfromance. Producing the same without render textures, just drawing circle shapes uses 100%+ CPU usage.
That would be your memory issue. RenderTextures are not light objects and should be used sparingly. I'm surprised it isn't causing performance issues.
string path = thisExePath();
int index = to!int(path.lastIndexOf("/"));
if (!GameFont.loadFromFile(path[0 .. index]~"/vertiup2.ttf")) {
writeln("Font failed to load");
}
string path = thisExePath();
int index = to!int(path.lastIndexOf("/"));
if (!GameFont.loadFromFile(path[0 .. index]~"/vertiup2.ttf")) {
writeln("Font failed to load");
}
How is pointing out that there is a link to the documentation you need not being helpful???There is a link to the «Bundle Programming Guide», follow it.Please don't respond unless you can be helpful.
Creating an Application Bundle
The simplest way to create an application bundle is using Xcode. All new application projects include an appropriately configured application target, which defines the rules needed to build an application bundle, including which source files to compile, which resource files to copy to the bundle, and so on. New projects also include a preconfigured Info.plist file and typically several other files to help you get started quickly. You can add any custom files as needed using the project window and configure those files using the Info or Inspector windows. For example, you might use the Info window to specify custom locations for resource files inside your bundle.
For information on how to configure targets in Xcode, see Xcode Build System Guide.
target.draw(star);
I'm drawing a circle shape to a RenderTexture. Comment that line of code and memory usage stabilizes at about 60mb consistently. Keep that line of code in and it climbs above 200mb+ over time.