Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

szymczyk

Member Since 15 Jan 2000
Offline Last Active Jan 14 2013 12:52 PM
*****

Posts I've Made

In Topic: SDL + XCode ... not linking?

14 January 2013 - 12:51 PM

It sounds like you're trying to have the SDL framework copied into your game's application bundle when you build the project, but the framework isn't being copied. Since you don't have the SDL framework installed on your system, the game doesn't work because there's no SDL framework on the system. You can check to see if the SDL framework is in your game's application bundle by selecting the game in the Finder, right-clicking, and choosing Show Package Contents. The SDL framework should be under Contents > Frameworks in the application bundle.

 

If the SDL framework isn't in the application, you have to tell Xcode to copy it. Instructions for doing this are in the following article:

 

Using SDL with Xcode 4

 

Read the comment from Adam on Feb. 2, 2012 in the article. He has a workaround if the SDL framework isn't being copied to the application bundle.


In Topic: Problem Loading PNGs with SDL_image on Windows

11 July 2012 - 12:26 PM

I found the cause of the release version crashing. After creating the OpenGL texture, I freed the memory of the SDL surface where I loaded the image file. Freeing the memory caused the crash.

Thanks for the help, everyone.

In Topic: Problem Loading PNGs with SDL_image on Windows

09 July 2012 - 03:10 PM

I was able to load the files when running the game inside Visual Studio. Inside the project folder are three folders: Debug, Release, and the name of the project. Inside Visual Studio the working directory was the folder that matched the project name. Moving the PNGs and DLLs into the folder matching the name of the project allowed me to load the PNGs when debugging in Visual Studio.

I moved on to getting the release versions to work. I passed the full path to the PNG files in my code. The program crashed when I launched from Windows Explorer. When I stepped through the code in Visual Studio's debugger, the first two PNG files loaded, but the third one didn't.

I do not have any non-English characters in my path.

When I use fopen, I pass the name of the file. fopen returns a pointer whose address points to NULL when I pass the full path to the file as the filename.

In Topic: Problem Loading PNGs with SDL_image on Windows

09 July 2012 - 01:04 PM

I run the release build from Windows Explorer. I also debug the debug build from Visual Studio. In both cases I place the PNGs and DLLs in the same directory as the executable. In both cases the PNG files do not load.

In Topic: Problem Loading PNGs with SDL_image on Windows

09 July 2012 - 10:30 AM

I created a simple PNG and tried loading it, but IMG_Load returned a NULL pointer. I took one of the PNG files I couldn't load and tried to load it in an old texture loading sample I had, and the file loaded. The sample used the same code I originally used: SDL_RWFromFile and IMG_Load_RW. I also used the same DLLs in both programs. I don't know why the old sample loads PNG files but my game doesn't.

Thanks for the help Spirrwell. You got me thinking deeper about the problem. When I discover a solution to this problem, I'll post it here.

PARTNERS