Handmade Hero»Forums»Code
Adam
7 posts
Resources for Similar Style of Games Dev on OS X
Hi guys,

Big fan of the series. It's really the sort of thing that gets me enthusiastic about programming! :) On the very (very) few things I've worked on throughout Uni I've always enjoyed just opening vim and building something from the ground up rather than using IDEs (not making a judgement, I just feel like I learn more that way!), so obviously this project speaks to me. :D

I'm quite keen on getting started with say, building my own renderer so I can understand the process of getting graphics on screen, but the issue is I'm on OS X, so I can't just follow HH. I've searched around and I can see there's a Mac port on github - which is great and instructive - but what I'm really looking for is somewhere I can go to have it maybe laid out for me step by step... can anyone point me in the direction of something like that? Are there guides similar to HH for OS X? I've seen the Apple Developer site and it looks like it wants me to be using XCode, but as I say, I'd really prefer to do it from scratch in a simple text editor, so I can understand the process a little better.

Cheers!
Misu Popescu
6 posts
Resources for Similar Style of Games Dev on OS X
Edited by Misu Popescu on
There is no similar tutorial for OS X (as far as I know).

However. you can follow HMH on your OSX machine just fine, you can download a trial version of Windows (it will work for 60 or 90 days if I remember correctly) and use Visual Studio Community for the compiler and VIM (or Emacs) as your text editor. Easiest way is to install Windows in a virtual machine, Virtual Box is free and you can run Windows 7/8.1/10 on it.

Windows 8.1 Enterprise will work for 90 days http://www.microsoft.com/en-us/ev...r/evaluate-windows-8-1-enterprise after that you can buy a license or download a new "evaluation" version :evil:
29 posts
I enabled the dark theme.
Resources for Similar Style of Games Dev on OS X
If you're just looking to learn without the clutter of Xcode, it's possible to follow the SDL2 "Handmade Penguin" tutorial. For any major differences, you can cross-reference the OS X repo. Most things, like opening windows and filling an audio buffer should work mostly the same on OS X as it does on Linux.

You need to install Xcode though, that's where you get your compiler! Also your debugger frontend. It's not as good as Visual Studio (the expression list is bad and Apple should feel bad), but it's better than only having the lldb prompt.
Mārtiņš Možeiko
2562 posts / 2 projects
Resources for Similar Style of Games Dev on OS X
Edited by Mārtiņš Možeiko on
Actually you don't need to install Xcode app to get compiler on OSX. You can get clang compiler and lldb debugger by installing "Command Line Tools (OS X NN.NN) for Xcode N" from https://developer.apple.com/downloads/ (requires Apple developer account, you can create it for free).

Or you can launch "xcode-select --install" command from Terminal. It will download and install same tools without whole Xcode app.
29 posts
I enabled the dark theme.
Resources for Similar Style of Games Dev on OS X
Ooh neat, I didn't know they offered a separate bundle.
Adam
7 posts
Resources for Similar Style of Games Dev on OS X
Thanks for the responses guys, lots of stuff for me to look into. I'll probably not go the straight up Windows route; I have a Windows PC, so I could follow along if I like - and I probably will as I have zero windows programming experience - but honestly I'm just plain interested in learning about how to develop this way for OS X.

drjeats
If you're just looking to learn without the clutter of Xcode, it's possible to follow the SDL2 "Handmade Penguin" tutorial. For any major differences, you can cross-reference the OS X repo. Most things, like opening windows and filling an audio buffer should work mostly the same on OS X as it does on Linux.

You need to install Xcode though, that's where you get your compiler! Also your debugger frontend. It's not as good as Visual Studio (the expression list is bad and Apple should feel bad), but it's better than only having the lldb prompt.


Thanks for that, I'll check out HH Penguin. I take it the fact it uses SDL2 means it's not in the same vein of 'zero libraries' as HH Windows? Not necessarily a dealbreaker for me, but it would be cool to understand the very basics of what SDL is doing when I ask it to create a window, say. In fact, when Casey gets to the point where he's making the platform layers for linux/osx/etc., will he be using SDL or will we get a similar crash course in 'here's how you get the OS to give you a window and how to draw to that window'? Just in case he's answered that elsewhere and I've missed it.

Cheers guys, thanks for answering my newb questions!
Adam
7 posts
Resources for Similar Style of Games Dev on OS X
Just an update to this, thought I would add in a link I found as a helpful starting point for anyone else who stumbles across this thread looking for something similar. Unearthed a short blog post about writing a minimalist Cocoa application.

This might end up being a terrible way of going about things but I suppose that's the entire point, and I can at least now see the bare minimum of steps needed to get a window to appear onscreen.
Mārtiņš Možeiko
2562 posts / 2 projects
Resources for Similar Style of Games Dev on OS X
Edited by Mārtiņš Možeiko on
Another good code to look at: https://github.com/emoon/minifb
It's a very small library that opens window and allows you to write block of pixels into it. Just a 3 .m files on OSX, but you can join all of them into one file.