Jump to content
  • Advertisement
Sign in to follow this  
cebugdev

Compiling My Sdl C++ In Mac

This topic is 817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all,

i knw there are Hundreds of tutorials on compilation of SDL to mac whenn doing google search, but excuse my ignorance as i am new and have no idea on mac environment/platform..

i have a game written in C++ and SDL on windows/linux and wants the same code to be compiled to Mac without rewriting most of the code, is it possible? i mean how about things like file IO, etc? i am totally new to Mac, i knw in linux basic FILE IO works but in Mac i am not sure,
so how to proceed with this? can the code be compiled and run without too much effort?

Share this post


Link to post
Share on other sites
Advertisement
Maybe?

If your code was written carefully and designed to be platform-agnostic, it should port over fairly easily. If not... you might be in for as much as a complete rewrite of large chunks.


Without seeing your code it's impossible to say for sure.

Share this post


Link to post
Share on other sites

Both Mac OS and Linux are POSIX systems.  Chances are good your code will just compile and run, as long as its self-contained.

Share this post


Link to post
Share on other sites

The whole point of SDL is that it can compile and run on many different platforms.  But you have to use SDL for all the platform stuff.  If you didn't use SDL for the window, input, rendering, file I/O, and threading, then you will most likely have to refactor your code to use SDL for everything.  But like ApochPiQ said, without seeing the code it's really hard to tell.

 

I do know you can compile an SDL program from the command line on a Mac because I've done it.  There were a few difference, like OpenGL headers being in a different place, but those kinds of things are solved by adding some #ifdef calls to some header files.

Edited by Glass_Knife

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!