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

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Can't compile SFML on Windows 11
« Last post by eXpl0it3r on Today at 05:11:49 pm »
It's not really something to "fix", because it's simply two different runtime libraries, which SFML then also would have to compile for and distribute. Currently there are no plans to do so, if you want to use UCRT, you'll need to rebuild SFML's dependencies yourself.

In the near-ish future, SFML will stop providing the dependencies as binaries and instead always build from source.
2
As you probably have already found out on the other thread, you need to download the MSVCRT version of WinLibs.
3
General / Re: Error when starting SFML program
« Last post by eXpl0it3r on Today at 05:08:14 pm »
The error is not enough to find out what's going on.

Does it simply become unresponsive? Have you implemented an event loop?
4
General discussions / Re: Italian members?
« Last post by eXpl0it3r on Today at 04:17:59 pm »
Please keep it in English here on the forum.

Feel free to send private messages to each other or join the Discord server and create an Italian thread, you might even find some more members there. :)
5
General discussions / Re: Italian members?
« Last post by euscar on Today at 03:45:14 pm »
Hi.
Is it possible to continue the discussion in Italian or do you have to write in English?
6
General / Re: Licensing Questions
« Last post by eXpl0it3r on Today at 03:20:57 pm »
You need to check each license separately to figure out the exact requirements.

The most critical one is OpenAL Soft, when using the audio module, as it's licensed LGPL and puts some constraint on how you can distribute the binary. SFML by default enforces shared linking (e.g. a DLL). Otherwise everyone would need to provide their source code: https://tldrlegal.com/license/gnu-lesser-general-public-license-v2.1-(lgpl-2.1)

Quote
If the software is statically linked (i.e. compiled into) your work, you must release object code or source code such that the user can modify the library. If otherwise (dynamically linked), you must make the source for the library available.

I suggest to check out the rest of the dependencies on TLDRLegal and check if it requires the inclusion of the license and/or copyright.

SFML is generally built on libraries with permissive licenses, as such it should be no problem to use it in a closed source product.
7
SFML projects / Re: American Football
« Last post by Arcade on Today at 03:41:07 am »
I've continued to add more features and polish to my American Football game over time since my last post here. Too many changes to list them all here, but most notably I decided to create a demo if anyone wants to give the game a try for free :)! The demo is fully featured other than limiting the "career" mode to 2 in-game weeks. It can be found on the game's itch.io page.
8
Graphics / Font LoadFromMemory issue.
« Last post by skylinx on Today at 01:27:58 am »
Hey guys. I cannot seem to load a font from memory properly even though it works perfectly with images and gives no errors. I pack images into a bin file and load them perfectly, yet when I try the same with any font file it fails to render. LoadFromMemory() returns no errors and seemingly loads the font perfectly. (I've breakpointed and it shows the font face and everything) But when rendering the font using this method it just doesn't work.
It does work if I load from file. I am not sure what I'm doing wrong. I will post the relevant code.

This method packs the font into the bin file. I use this method with images and it works beautifully.
void osb::AssetPacker::PackFileToBin(string path, ofstream* dataStream)
{
        // open the file as binary
        ifstream loaded_file{ path, ifstream::binary };

        if (!loaded_file)
        {
                Logger::LogMessage("~Packing Failed! Could not open file: " + path);
                return;
        }

        // create the buffer to store the texture data
        vector<char> buffer;

        // get end size of texture
        loaded_file.seekg(0, loaded_file.end);

        // gives conversion warnings, static cast removes them
        // const auto length = texture_file.tellg()
        streampos sLength = loaded_file.tellg();

        // make sure stream length is not negative, or possible memory overflow
        if (sLength < 0) { return; }

        const auto length = static_cast<size_t>(sLength);
        if (!length)
        {
                Logger::LogMessage("~Packing Failed~ Cannot load zero byte file: " + path);
                return;
        }

        // resize buffer to the length of the texture
        buffer.resize(length);

        // seek to start of texture
        loaded_file.seekg(0, loaded_file.beg);

        // read texture from start to end into buffer vector
        auto start = &*buffer.begin();
        loaded_file.read(start, length);
        loaded_file.close();

        // append each character in buffer to file

        for (size_t i = 0; i < buffer.size(); i++)
        {
                *dataStream << buffer[i];
        }

        Logger::LogMessage("~Pack Success! Packed file: " + path + " ~ Buffer Size: " + to_string(buffer.size()));
}

 

The method below loads the font from the bin into a Font variable in the class.
Uncommenting the last line allows the font to render, it's loading from memory which just causes it to be dots.

void osb::AssetPacker::LoadFontFromBin()
{
        std::ifstream dataIn;

        // open the data file
        dataIn.open("fontdata.bin", std::ifstream::binary | std::ifstream::in);

        // begin reading binary data file
        char c;
        std::vector<char> buffer;
        if (dataIn.is_open())
        {
                // read all characters in data file; not skipping white space
                while (dataIn >> std::noskipws >> c)
                {
                        // push the character into the buffer
                        buffer.push_back(c);
                }

                Logger::LogMessage("Final Font Buffer Size: " + std::to_string(buffer.size()));
                dataIn.close();
        }

        if (!standard_font.loadFromMemory(&buffer[0], buffer.size()))
        {
// this never happens yet the font does not render,
                Logger::LogMessage("Font Load Failed | Buffer Size : " + buffer.size());
                return;
        }
       
        // standard_font.loadFromFile("assets/FiveByFive.ttf");
}
 

I'm really not sure why it's broken considering this works with images. Any guidance would be appreciated.
This is what it looks like when loading from memory.



Works perfectly fine when uncommenting the last line which leads me to believe it's how I'm loading from memory rather than some reference problem.
standard_font.loadFromFile("assets/FiveByFive.ttf");


9
General discussions / Re: Italian members?
« Last post by roccio on August 07, 2022, 10:25:39 pm »
Here I am.
10
General / Licensing Questions
« Last post by Nucondria on August 07, 2022, 10:19:54 pm »
I apologise if this has been asked before, but i was not able to find this exact question, or an answer in general.

I am still new so do forgive my stupidity.

1.
The license of SFML itsself is clear to me, but those of the external libraries used by SFML confuse me.
How exactly do i have to include them? Or is referencing the libraries and the according license enough?

2.
Assuming my product is an end product, what licenses am i legally allowed to use for it?
Are there incompatibilities with the ones of the external libraries used by SFML?
Can i keep my product closed source?

I am at a loss here, so a detailed answer of what i should include where and why would be appreciated!

Pages: [1] 2 3 ... 10
anything