[SDL] Loading Resources on Windows
Lilith Calbridge
lilith at dcccd.edu
Fri Jan 4 06:58:44 PST 2008
I've been wrestling with a similar problem in another API, though the API itself shouldn't be the source of the problem. The question I have for you is, is the problem arising when you're running the program from the compiler in debug mode? If so, the current directory may be considered to be either the compiler's home directory or the directory of the base of the solution/project.
At the very least check your link and see if there's an option to place a Start-in directory as the same directory as your executable.
--
Lilith
>>> On 1/4/2008 at 8:50 AM, Micah Brening <micah.brening at gmail.com> wrote:
> Micah Brening <micah.brening <at> gmail.com> writes:
>
>>
>> Hello All,
>>
>> I'm running into a stupid problem. I have a game written in C with SDL.
> I'm
>> also using SDL_image.
>>
>> On Linux, it all runs fine. On windows, it runs fine if I execute it from
> the
>> directory I installed it to. But if I try to use a link (say from the start
>> menu) it fails to load the images which are either in the same directory, or
>
> in
>> a child directory.
>> Thanks!
>>
>> Micah
>>
>
> Ok, so the mystery deepens.
> I ran some basic tests. simple initalization, set video mode, and load a
> png
> in the same directory as the executable. That worked. Even with a link in
> the start menu.
>
> So now I have two different questions. Is there something that would make
> the
> executable think it was in a different directory than where it really is?
> And
> second, is there a simple way of getting the current working directory that
> the executable THINKS it is running from?
>
> Sorry if this is a beginner question.
>
> Thanks for any assistance!
>
> Micah
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
More information about the SDL
mailing list