GLBasic forum

Main forum => GLBasic - en => Topic started by: XanthorXIII on 2010-Sep-07

Title: Loading Media Issues
Post by: XanthorXIII on 2010-Sep-07
While I have found a work around to get my media to load I need to know the proper way of doing it when building my programs. Under my project I create a media folder, I stick my sprites and what not into that folder. I then go to build the application. Everything compiles and the program runs, oh lovely just a black screen.
What I found then was that I had to copy the media folder to another folder apps. What am I doing incorrectly to not get it to run in the build phase?
Technically I should be able to stick a folder called media in my project directory that gets copied over or it runs from that. I think I saw something about that in one of the patch notes but something I'm doing is not quite right.
Title: Re: Loading Media Issues
Post by: Bursar on 2010-Sep-07
When you compiled your app, you should have noticed a directory had been created called 'myapp.app', and your .exe file is located in that directory.

Your Media directory needs to live inside that directory. You don't need a seperate media directory at the same level as your project files.
Title: Re: Loading Media Issues
Post by: XanthorXIII on 2010-Sep-07
Does the folder get created when I create my project so I can put those files there first before I compile?
Title: Re: Loading Media Issues
Post by: MrTAToad on 2010-Sep-07
The .app directory (and thus the Media directory) gets created when the program is compiled.

You can, of course, create the directory structure beforehand - but if you change the program name, a new directory structure will get created with the new name.
Title: Re: Loading Media Issues
Post by: XanthorXIII on 2010-Sep-07
So on First Compile and run it's going to fail on me because it can't find the media to load? Doesn't that seem a bit odd?

Title: Re: Loading Media Issues
Post by: MrTAToad on 2010-Sep-07
I usually compile the program after typing in a few lines - that way the correct directory structure is present.

It might however, be best if the .app & sub-directory creation is moved to when the project is created.
Title: Re: Loading Media Issues
Post by: XanthorXIII on 2010-Sep-07
In doing my work I'd almost like to have a work directory and a output directory. While I guess it's not much of a bother doing what I'm told is the proper way of handling files, I would think that having the work and output directory separate would be ideal.
Am I not mistaken?
Title: Re: Loading Media Issues
Post by: MrTAToad on 2010-Sep-07
No, because doing that causes immense problems for Mac executables - its why the .app directory (and the media folder inside it) was created.
Title: Re: Loading Media Issues
Post by: XanthorXIII on 2010-Sep-07
Ok, that answers the why question for me.
Thank you.