0
\$\begingroup\$

So I'm screwing around with c++ and SFML, when I thought to myself the following:

If the images are compiled into the executable, with enough sprites for the game, memory might become a problem at some time? I might have misunderstood how images are loaded, but they aren't in the release directory so they must compiled and put into memory when the executable is loaded?

\$\endgroup\$
3
  • \$\begingroup\$ Errr.. how are you loading the images? \$\endgroup\$
    – Vaillancourt
    Dec 20, 2015 at 3:33
  • \$\begingroup\$ Using tex.loadFromFile("Somefile.png"); i.imgur.com/5tZ2Z5T.png \$\endgroup\$
    – Valdemar
    Dec 20, 2015 at 3:35
  • \$\begingroup\$ Loading then that way does not compile then into the binary, you just store the path to the files in the binary... FEZ loads the entire game into memory upon start and has no issues with this at all, it uses roughly 256mb to host the entire game. \$\endgroup\$
    – rlam12
    Dec 20, 2015 at 3:39

1 Answer 1

0
\$\begingroup\$

The images are not saved in the executable.

You store the path to the files in the executable. And the files are typically in the folder of the exe.

When you use Visual Studio, the exe might be in a folder, while the "environment" folder that the exe will look in to find files could be in another (the "Working Directory").

Your images could be in the "working directory" while the exe is in another directory.

This really depends on your setup and your needs (and your Visual Studio configuration).

\$\endgroup\$
1
  • \$\begingroup\$ @Valdemar Np; sometimes it more about learning about the tools than the product per se. :P \$\endgroup\$
    – Vaillancourt
    Dec 20, 2015 at 4:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .