Hmmmm and yours is working? This is how I do it:
Yeah, mine is working well. It has been for the past year or so that I've been using it. Admittedly it's pretty light on features, but I will add those as I need them (i.e. window resizing, etc.).
Yeah however it's not working. I'm currently going through Casey's OpenGL section. I hope it helps to learn and understand it a little bit and hopefully implement an own more simplified version of this shenanigans. But if you see what I'm doing wrong then please tell me.
I'm not an OpenGL guy at all, so I'm afraid I can't see by looking at your code what is wrong. What I would do in this case is just start very simple though -- just get something drawing on the screen. Take away all the viewport stuff, matrices, etc. Maybe look at some OpenGL tutorials or sample code to just get something on the screen, then you
can build up from there, and that will make it simpler to find out what your problem is. Unless someone else can spot it in the forums. :)
I just don't want the drawing where apple thinks I should do it. So I don't like using views they so much force a design pattern on you. Is there a C Mac OS X API? I heard there was something like Carbon but its deprecated now and its 32 bit. I can't find any documentations. Does it still work?
Fair enough, but fighting it doesn't do any good either (unless it's for a good reason). It's the way Cocoa is structured, for better or worse. And you can certainly minimize your dependency on the view by having it only handle the final bitmap blit, while the rest of your logic is outside of it.
There are a lot of APIs for OS X that are C-based. Not so much for things like NSWindow, or NSView, but CoreGraphics is all C-based, as is Audio Units and Core Foundation. So in other words, most of the high level UI stuff is Objective-C, while many underlying frameworks are C. Carbon is still supported in old apps for legacy purposes, but there are no Carbon APIs in the new OS X SDKs. The only way you could use Carbon (I believe) would be to get your hands on the 10.6 SDK or earlier (I can't remember exactly when they removed the Carbon APIs from the OS X SDKs, but I think 10.6 was the last one). And the only way to get that is to download an old version of Xcode that has that SDK in it. But I would stay away from Carbon. There's no reason at all to use it.
One more thing: How fast will the Handmade Hero Engine/Game be when it's done? Like compared to stuff like Game Maker, Unity usw. Regarding 2D.
As fast as it needs to be for this game. It's hard to compare against commercial game engines that are meant to be more general purpose, but we've seen that we will hit 60 fps using hardware rendering for this game, so it will be fast enough to support that.