Compiling My Sdl C++ In Mac

Started by
2 comments, last by Glass_Knife 7 years, 8 months ago
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?
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.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

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

Stephen M. Webb
Professional Free Software Developer

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.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

This topic is closed to new replies.

Advertisement