SDL help

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: SDL help

Post 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.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: SDL help

Post 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.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: SDL help

Post 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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: SDL help

Post 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.
User avatar
Maevik
Chaos Rift Junior
Chaos Rift Junior
Posts: 230
Joined: Mon Mar 02, 2009 3:22 pm
Current Project: www.keedepictions.com/Pewpew/
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: Long Beach, CA

Re: SDL help

Post by Maevik »

Put ball.bmp in the test file
My love is like a Haddoken, it's downright fierce!
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: SDL help

Post by herby490 »

Thanks that works. If I wanted to distribute an application I made where would I put it.
User avatar
kostiak2
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 74
Joined: Tue Mar 24, 2009 4:08 pm

Re: SDL help

Post 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.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: SDL help

Post by herby490 »

Thanks hopefully everything will work with SDL now.
User avatar
Maevik
Chaos Rift Junior
Chaos Rift Junior
Posts: 230
Joined: Mon Mar 02, 2009 3:22 pm
Current Project: www.keedepictions.com/Pewpew/
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: Long Beach, CA

Re: SDL help

Post 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.
My love is like a Haddoken, it's downright fierce!
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: SDL help

Post by herby490 »

If I put the code in a sub folder of something I am distributing will it work?
Post Reply