20 posts
Check out my version of OS X platform layer
Hey guys!

I've just finished the first usable version of my platform layer implementation for OS X. It works for me as a full-featured drop-in replacement for win32 platform layer at least for day 29 - 32 sources (it's where I am now). If you are following along on OS X please check this out and let me know how it works for you.

I've commented the source code as detailed as possible so you can easily read it through and understand what I was thinking. The whole thing is just one .m file and a simple bash script as a "build system". I've also included a hand-coded application bundle so you can launch the game as a normal OS X application, put it in Dock etc.

Neil Blakey-Milner
45 posts
Check out my version of OS X platform layer
Nice work!

In my own OS X platform layer (not for Handmade Hero, but for something I'm playing with based on the same architecture) I ended up discovering that you _can_ just use C++. The build line for the platform layer part:

clang -std=c++0x ${WARNFLAGS} -framework Cocoa -framework QuartzCore -framework OpenGL -o build/debug/osx source/hajonta/platform/osx.mm${DEBUG_FLAGS} \${INCLUDES}

The osx.mm file also just #includes a .cpp file for anything that isn't Objective C/Cocoa-specific.

The files in question: https://github.com/nxsy/hajonta/blob/master/source/hajonta/platform/
Lars Hamre
1 posts
Check out my version of OS X platform layer