Page 2 of 2

Re: SDL help

Posted: Sat Apr 04, 2009 1:15 pm
by herby490
I ran the actual exe file and it did not crash but it only printed two balls on the screen then it closed instead of waiting for me to close it. It still does not work from the IDE which is Visual Studio and SDL_GetError still gives me cannot open ball.bmp.

Re: SDL help

Posted: Sun Apr 05, 2009 10:01 am
by herby490
I put in the exact path of the bmp and fixed the thing that was making it quit after putting two balls on the screen. Is there any other way to do that besides put the exact path because if a wanted to distribute something then the path would be different.

Re: SDL help

Posted: Sun Apr 05, 2009 10:23 am
by dandymcgee
herby490 wrote:I put in the exact path of the bmp and fixed the thing that was making it quit after putting two balls on the screen. Is there any other way to do that besides put the exact path because if a wanted to distribute something then the path would be different.
It sounds like you may not be putting them in the correct path. If you're using Visual Studio the project folder usually contains a "bin" folder which in turn contains a "debug" and a "release" folder. Those are likely the .exes that are running, and they need to have ball.bmp in their path(s) as well.

Re: SDL help

Posted: Sun Apr 05, 2009 11:11 am
by herby490
Visual Studio does not have a bin folder. In the project folder it has a Debug, Release, and a test folder(Test is the name of the application). In the Debug and Release folders there is the exe and that is also where I put the ball.bmp. In the test folder there is another Debug and Release folder but these folders do not have the exe but instead have the object file and manifest file and so on.

Re: SDL help

Posted: Sun Apr 05, 2009 1:46 pm
by Maevik
Put ball.bmp in the test file

Re: SDL help

Posted: Sun Apr 05, 2009 1:55 pm
by herby490
Thanks that works. If I wanted to distribute an application I made where would I put it.

Re: SDL help

Posted: Sun Apr 05, 2009 2:06 pm
by kostiak2
herby490 wrote:Thanks that works. If I wanted to distribute an application I made where would I put it.
In the same folder you put the exe in.

Re: SDL help

Posted: Sun Apr 05, 2009 2:09 pm
by herby490
Thanks hopefully everything will work with SDL now.

Re: SDL help

Posted: Sun Apr 05, 2009 7:27 pm
by Maevik
You can also clean up the root directory by putting them in a folder. In your code you would need to change the opening function call to something like
example.open( "files//ball.bmp" );

where files is a folder in your root directory.

Re: SDL help

Posted: Sun Apr 05, 2009 8:16 pm
by herby490
If I put the code in a sub folder of something I am distributing will it work?