Jump to content
  • Advertisement
Sign in to follow this  
KazenoZ

Running a C++/SDL game on a Mac.

This topic is 2529 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

Hello,

Well, this may come of as really really nubile of me here, but to be honest, I don't know the first thing about Macs, and would really like some information for development.

Say I have a game I made on Windows with C++ and SDL, made sure not to use any Windows API calls so it could be compatible with Macs, would it work if I just passed the files over?
I hear that Macs don't actually even use file types directly, would they know to recognize a .exe as an executable? What about Mircosoft's Redistributional Package that's required to run the game on Windows? Is there an equivalent? Is it even needed? If that doesn't work, what do you need to do to port a PC designated game?

It would really be helpful if someone could provide a simple article or chart about differences in development, and actually, basic usage, between a Mac and a PC, like you could tell, I never really touched a Mac at all, and don't know anything about them.

Thanks alot.

Share this post


Link to post
Share on other sites
Advertisement

Hello,

Well, this may come of as really really nubile of me here, but to be honest, I don't know the first thing about Macs, and would really like some information for development.

Say I have a game I made on Windows with C++ and SDL, made sure not to use any Windows API calls so it could be compatible with Macs, would it work if I just passed the files over?
I hear that Macs don't actually even use file types directly, would they know to recognize a .exe as an executable? What about Mircosoft's Redistributional Package that's required to run the game on Windows? Is there an equivalent? Is it even needed? If that doesn't work, what do you need to do to port a PC designated game?

It would really be helpful if someone could provide a simple article or chart about differences in development, and actually, basic usage, between a Mac and a PC, like you could tell, I never really touched a Mac at all, and don't know anything about them.

Thanks alot.


The compiled binaries are not portable, you have to compile the application separatly for Mac using a Mac compiler, the easiest way is probably to get a mac, install Xcode on it and then build the game from there)

Share this post


Link to post
Share on other sites
Is anything different with the coding procedure then, or will copypasting the Windows code be enough?

You'd think that by now someone would've come up with a program that can convert the binaries to crossplatform, wouldn't you? =\

Share this post


Link to post
Share on other sites

Is anything different with the coding procedure then, or will copypasting the Windows code be enough?

You'd think that by now someone would've come up with a program that can convert the binaries to crossplatform, wouldn't you? =\


Wine does that, (Allthough it converts the binaries at runtime), C# and Java solves it by using a VM.

Copypasting the code (or just making a new project and importing the cpp files) should be enough assuming you didn't use any platform specific code.

Share this post


Link to post
Share on other sites
Oh?
Is the VM an automated process, or do I need to do something to make it happen?
I'm working on porting over to Java so I could put it up as a web browser game in addition executable anyway, would be neat if I could kill 2 birds with one stone.

Share this post


Link to post
Share on other sites
Basically, Java doesn't get translated to binaries that can be executed directly. The code is converted to bytecode which is later read by a VM which does whatever the bytecode says. This allows Sun (or allowed, now that it's owned by Oracle) to write the virtual machines (VMs) for different platforms more or less independently of the code you program. That way you get to write the program once and use the appropriate JVM for the platform you're using to execute it.

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!