Wednesday 21 January 2015

Cross Platform FTW!

Mac:




Windows 7:




For anyone interested in the details.

Windows:
1. Install MinGW and make sure to get the basic gcc, c++ and make packages.
2. Install FreeType for Windows.
3. Download the SDL2, SDL2_image and SDL2_ttf MinGW development files -
  a. Copy headers to the MinGW/include dir.
  b. Copy the libs to the MinGW/libs dir.
  c. Copy ALL of the the dll's to the game exe dir (easiest solution). Obviously, do this after step 5.
4. Configure Eclipse search directories as above, and link to mingw32 and sdl2main.
5. If you have been good with your cross platform coding, the source builds perfectly without modification.
6. Spend half an hour wondering why the game seems to be running properly with all debug output showing, but there is no game window. Then remember that you set the window to startup with x=1280 for testing with dual monitor, and now you only have one monitor. Change the x back to 0 and voila.

(alright, so step 6 is only for me)

Mac:
1. Download the SDL2 sources, extract, run "configure," "make" and "make install."
2. Thank me for step one, and not having to bother with Frameworks, sdlmain etc. as most of the online tutorials say.
3. Project will build in Eclipse without source modification (if you've been cross-platform friendly)
4. Voila.

No comments:

Post a Comment