Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
Errr.. how are you loading the images? – Alexandre Vaillancourt Dec 20 '15 at 3:33
    
Using tex.loadFromFile("Somefile.png"); i.imgur.com/5tZ2Z5T.png – Valdemar Dec 20 '15 at 3:35
    
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. – rlam12 Dec 20 '15 at 3:39
up vote 0 down vote accepted

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).

share|improve this answer
    
Thanks for the answer, it helped a lot. – Valdemar Dec 20 '15 at 4:06
    
@Valdemar Np; sometimes it more about learning about the tools than the product per se. :P – Alexandre Vaillancourt Dec 20 '15 at 4:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.